I am trying to use a nested for loop that parses through all the worksheets (1st For Loop) and parses through each Pivot table in each worsksheets (2nd For loop). Within 2nd For loop, I am trying to change the pivot filter value based on a combobox selection.
Below is the code, but it does not loop through the 2nd for loop.
Private Sub bo_combobox_Change()
Dim a As String
Dim pt As PivotTable
Dim ws As Worksheet
If bo_combobox.Value <> "" Then
For Each ws In ActiveWorkbook.Worksheets
For Each pt In ThisWorkbook.PivotTables
With pt.PivotFields("Objective")
.ClearAllFilters
.CurrentPage = bo_combobox.Value
Debug.Print (.CurrentPage)
End With
Next pt
Next ws
End If
End Sub