VBA修改PPT中表格里的指定单元格的字体颜色和加粗
需求:将excel中的表格粘贴到ppt中后,修改其中某些单元格的字体颜色并加粗,注意是修改表格中的,不是文本框中的目前找到了修改单元格填充颜色的方法,但是单元格里文字的格式修改没有找到,请大神指教一下~
Sub 修改格式()
Dim celSelected As Cell
ActiveWindow.Selection.SlideRange.Shapes("内容占位符 4").Select
Set celSelected = ActiveWindow.Selection.ShapeRange.Table.Columns(1).Cells(1)
If celSelected.Selected Then
With celSelected
.Shape.Fill.ForeColor.RGB = RGB(255, 0, 0) '红色-填充颜色修改
End With
End If
End Sub
Sub 修改格式()
Dim celSelected As Cell
ActiveWindow.Selection.SlideRange.Shapes("内容占位符 4").Select
Set celSelected = ActiveWindow.Selection.ShapeRange.Table.Columns(1).Cells(1)
If celSelected.Selected Then
With celSelected
.Shape.Fill.ForeColor.RGB = RGB(255, 0, 0) '红色-填充颜色修改
celSelected.Shape.TextFrame.TextRange.Font.Color.RGB = RGB(0, 0, 255)
End With
End If
End Sub 非常感谢!!
页:
[1]