VBA for refreshing pivot tables after changes

beckyinDC

Board Regular
Joined
Mar 24, 2011
Messages
56
my spreadsheet will have 2-4 pivottables with 2-3 pivotcaches.

the data sources will be very manageable- a few columns on a separate spreadsheet for each cache.

updates will occur via pull of data frm other sources via VBA or direct user edits. new rows may be dded. After some update has occurred, I want to have VBA trigger the update to the displayed pivottables when user clicks button.

I had coded 1 pivottable and cache combo where I just deleted the worksheet where the pivottable existed and recreated it when I wanted to refresh. That worked- but it seems like it might be overkill?

no additional columns would have been added, but rows might be added.

if I updated the sourcedata value of the pivotcache, would I need to do anything to the related pivottables to have the changes reflected there?
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
I forgot to explain somthing...

the data source (for the pivottable I have worked out in code) is established by SQL against an external source. Since that data could be updated, added to, or deleted from...I wanted to just delete and recreate that data. Seemed simplest.

so that was why I was originally going with a delete and recreate approach to the pivot table itself.
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,682
Members
452,937
Latest member
Bhg1984

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