要在vba中删除图表系列,只需要使用系列对象的Delete方法即可。
但是如果使用For Each 循环语句 循环删除则会报错,如下所示:
For Each oSeires In .FullSeriesCollection
With oSeries
.Delete
End With
Next
应该改成逆序用序号来访问集合中的对象来删除:
For i = .FullSeriesCollection.Count To 1 Step -1
.FullSeriesCollection(i).Delete
Next i


发表评论