Pivot Table Refresh

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,601
Office Version
  1. 2021
Platform
  1. Windows
I would like to know how to set the Pivot table so that it refreshes automatically each time data updated

I am using Excel 2007

Your assistance will be most appreciated
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Try this:

Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.PivotTables("PivotTable1").RefreshTable
End Sub
 
Upvote 0
Hi Robert

Thanks for the help. I right clicked on the pivot table sheet and pasted the code under "view code"

For some unknown reason when changing the raw data, the pivot table data does not change

It would be appreciated if you would check & advise
 
Upvote 0
Hi Robert

Thanks for pointing me in the right direction. This is much appreciated

My Pivot Table is in a seperate worksheet and the code below works perfectly

Private Sub Worksheet_Activate()
ActiveSheet.PivotTables("PivotTable1").RefreshTable
End Sub
 
Upvote 0
Robert,

I'm looking for code to put in a workbook that has 6 pivot tables (report.xlsm) that is linked to a separate workbook with the data (source.xlsm). I have tried using Refresh feature in report.xlsm but it does not reflect changes from the data source.xlsm. Any suggestions?
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top