1
VBA很新。我有一个工作簿,在选项卡上有大约8个图表,并且有很多选项卡。每个图表都需要根据相同的值进行过滤,并且我正在努力让我的宏工作。下面是我有:VBA多图表过滤器
Sub ChartFilter()
'
'
'
'
For Each Chart In ActiveWorkbook.Charts
ActiveChart.Legend.Select
With ActiveChart.PivotLayout.PivotTable.PivotFields("Category1")
.PivotItems("Value1").Visible = True
.PivotItems("Value2").Visible = True
.PivotItems("Value3").Visible = True
.PivotItems("Value4").Visible = True
.PivotItems("Value5").Visible = True
.PivotItems("Value6").Visible = True
.PivotItems("Value7").Visible = True
End With
Next Chart
End Sub
你知道我要去哪里错了吗?
谢谢!
是图表数据透视图? –