I am looking for a solution on updating a pivot table when new data is entered into the source table or database. I know the code below will work. I would prefer not to leave the worksheet to return to update. Any suggestions on the code and the event it needs to be place would be appreciated.
Private Sub Worksheet_Deactivate()
Dim pt As PivotTable
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
For Each pt In ws.PivotTables