Hello,
I am trying to change Filter in Multiple Pivot Tables based on a Cell Value. However, I keep getting the error Error 1004 Unable to set the CurrentPage property of the PivotField class. I would really appreciate if anyone knows how I can fix it. Here is my code, I also attached an example. Thank you so much
Private Sub CommandButton1_Click()
Dim a As String
Dim pt As PivotTable
ThisWorkbook.Worksheets("Sheet3").Activate
a = Worksheets("Sheet3").Cells(2, 3).Value
For Each pt In ActiveSheet.PivotTables
With pt.PivotFields("Order")
.ClearAllFilters
.CurrentPage = a
End With
Next
End Sub
Bookmarks