Microsoft Office Tutorials and References
In Depth Information
Synchronizing Page Fields of Pivot Tables
View the Appendix to learn how to store this procedure
in a ThisWorkbook module.
Option Explicit¶
' * * * * *¶
Private Sub Workbook_SheetChange(ByVal Sh As Object, _¶
ByVal Target As Range)¶
If TypeName(Sh) = "Worksheet" Then¶
On Error GoTo exiting:¶
With Target.PivotTable¶
Application.EnableEvents = False¶
SynchPivotTables Target.PivotTable¶
Application.EnableEvents = True¶
End With¶
End If¶
exiting:¶
End Sub¶
Exl
The first part of the code goes in a Standard module in the workbook or
template of interest. The rest goes in the ThisWorkbook module of the same
workbook.
Tip: This macro does not work in Excel 97 or Excel 2000, because changing a page field does
not fire a Change event in those versions of Excel.
Search JabSto ::




Custom Search