试试下面的代码,来自论坛,重点就是需要遍历:
Sub 批量修改图表字体颜色()
Dim Myslide As Slide '声明对象变量为幻灯片
Dim Myshape As Shape '声明对象变量为形状
Dim MySeries As Series '声明对象变量为图表系列
For Each Myslide In Application.ActivePresentation.Slides '在幻灯片集合
内循环For Each Myshape In Myslide.Shapes '在形状集合内循环
If Myshape.HasChart Then '判断形状是否为图表
Set MySeries = Myshape.Chart.SeriesCollection(1) '设置变量为图表内的系列1
With MySeries.DataLabels
.RGB = RGB(225, 11, 0)
End With
End If
Next Myshape
Next Myslide
End Sub