Hi All,
Does anyone know how to add the visible items I have in a pivot to a combobox
my code is looping through every item not just the visible ones?
Thanks in advance
Does anyone know how to add the visible items I have in a pivot to a combobox
my code is looping through every item not just the visible ones?
Thanks in advance
Code:
Dim pt As PivotTable
Dim pf As PivotField
Set pt = Sheet5.PivotTables("PivotTable2")
Set pf = pt.PivotFields("Status")
pf.ClearAllFilters
Me.ComboBox1.Clear
If Me.CheckBox1 = True Then
Me.ComboBox1 = "All Active Campaigns"
pf.CurrentPage = "Active"
Else
Me.ComboBox1 = "All Campaigns"
End If
For Each Item In pt.PivotFields("Name").PivotItems
Debug.Print Item
Next