Macro does not work after company update

  • Thread starter Thread starter aaronb
  • Start date Start date
A

aaronb

This macro.....

Private Sub Worksteet_Change(ByVal Target As Range)
PivotTables("PivotTable1").RefeshTable
PivotTables("PivotTable2").RefeshTable
End Sub

No longer works after company I work for updated excel.
It now goes into some sort of continuous loop.

Any Idea how to make it work??

Thanks in advance.
 
Private Sub Worksteet_Change(ByVal Target As Range)
application.enableevents = false
PivotTables("PivotTable1").RefeshTable
PivotTables("PivotTable2").RefeshTable
application.enableevents = true
End Sub

to stop the refresh from call the _change event.
 
Back
Top