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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top