我想使用 VBA 在資料透視分析過濾器中獲取專案,是否有任何功能支持?

uj5u.com熱心網友回復:
試試下面的代碼。
Sub test()
Dim pt As PivotTable
Dim pf As PivotField
Set pt = Sheets("Sheets").PivotTables("PivotTables")
Set pf = pt.PivotFields("PivotFields")
With pf
For i = 1 To .PivotItems.Count
Debug.Print .PivotItems(i).Name
Next i
End With
End Sub
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/479540.html
上一篇:串列框為空時型別不匹配
