I am attempting to use the below code, but when using the EnableEvents, the three lines of pivot tables do not update. If I remove the EnableEvents, then it enters a never ending loop. I need for when any one of the pivot tables is updated/changed, for the others to automatically update as well, then the rest of the code runs. Thanks for any help.
Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)
Dim DAO As String
DAO = Range("F12").Value
'reset the formatting for the pivot tables on the Options tab after a refresh
If (Target.Name = "DataAsOf") Or (Target.Name = "ThisYearPeriod") Or (Target.Name = "LastYearPeriod") Then
Application.EnableEvents = False
Worksheets("Options").PivotTables("DataAsOf").RefreshTable
Worksheets("Options").PivotTables("ThisYearPeriod").RefreshTable
Worksheets("Options").PivotTables("LastYearPeriod").RefreshTable
Application.EnableEvents = True
Range("E10:F10").Copy
Range("E12:F12,E32:F32,E52:F52").PasteSpecial Paste:=xlPasteFormats
Worksheets("Options").Select
Range("E76").Select
Application.CutCopyMode = False
End If
Bookmarks