Hi,

I am trying to work on a code that allows me to filter all the pivot tables in my workbook based on the main pivot table's filter field.


I have a code working but it only filters the pivot tables on the same sheet. I would like to have a code that will filter the pivot table on the other sheets as well.

here's the code that i have which matches the filter all pivot table on the same sheet. What do i need to add to make it work on other sheets?

Option Explicit
Private Sub Worksheet_PivotTableUpdate(ByVal Target As pivotTable)
Dim ptTable As pivotTable, strField As String
strField = "Weekend"
On Error GoTo ExitPoint
Application.EnableEvents = False
For Each ptTable In ActiveSheet.PivotTables
    If ptTable <> Target Then
        ptTable.PageFields(strField).CurrentPage = Target.PageFields(strField).CurrentPage.Value
    End If
Next ptTable
ExitPoint:
Application.EnableEvents = True
End Sub