Hi all,
I have two pivot tables on one sheet and I want the page fields on the second to change when I change the first pivot table. I found the below code and have applied it to one of the three page fields I have, but can't seem to duplicate it for the other page fields:
Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)
Dim ptTable As PivotTable, strField As String
strField = "SLS_MDL"
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
You can see in the code that my page field is "SLS_MDL". I also have the fields "origin" and "destination" I'd like to have change in both places.
Thanks!
Bookmarks