Auto-refresh pivot table?

  • Thread starter Thread starter kk_oop
  • Start date Start date
K

kk_oop

Hi. Is there a way to set up a pivot table so it will automatically
update when its source data changes. It seems that by default, I need
to explicitly tell it to refresh.

Thanks!

Ken
 
Hi. Is there a way to set up a pivot table so it will automatically
update when its source data changes. It seems that by default, I need
to explicitly tell it to refresh.

Thanks!

Ken

I'll answer my own question. Enter the following VBA code for the
worksheet that contains the pivot table (get to the code by entering
alt+F11):

Private Sub Worksheet_Activate()

'update pivot table when sheet becomes active

Sheets("NameOfWorksheet").PivotTables("NameOfPivotTable").RefreshTable

End Sub

If you have made a chart from the Pivot table, enter the following VBA
for the Chart:

Private Sub Chart_Activate()

'update pivot table when chart becomes active

Sheets("NameOfWorksheet").PivotTables("NameOfPivotTable").RefreshTable

End Sub

This in insures that the data will be up to date whenever the table or
chart is viewed.

I hope other's will find this useful!

See ya,

Ken
 

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