I need to change the pivot report filters of pivots 2,3,4 and 5 based on the selection of pivot 1 filter. I get the "Unable to get the PivotFields property of the PivotTable Class". I'm sure it's something simple but I just can't get this to work.


Private Sub Workbook_SheetPivotTableUpdate(ByVal Sh As Object, ByVal Target As PivotTable)


Dim pageval As String
Dim i As Integer


pageval = ActiveSheet.PivotTables("PivotTable1").PivotFields("Code").CurrentPage


Set ActiveSheet.PivotTables("PivotTable2").PivotFields("Code").CurrentPageName = pageval
Set ActiveSheet.PivotTables("PivotTable3").PivotFields("Code").CurrentPageName = pageval
Set ActiveSheet.PivotTables("PivotTable4").PivotFields("Code").CurrentPageName = pageval
Set ActiveSheet.PivotTables("PivotTable5").PivotFields("Code").CurrentPageName = pageval


End Sub