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
你知道我要去哪裏錯了嗎?
謝謝!
是圖表數據透視圖? –