VBA "update" pivot table fields

ncheever

New Member
Joined
Apr 24, 2013
Messages
9
Hi,

I have a pivot table that I need to update quarterly. The values are "Sum of 20134 DEC", "Sum of 20134 WAGES", and "Sum of 20134 EST". When I receive the new quarter's data, I don't want to create a new pivot table, but just refresh/ update the fields mentioned above.

I have set the values below as references for my vba code that update automatically in the spreadsheet.

E1 = Sheets("PT").Cells(1, 13).Value <---this equals "Sum of 20134 DEC"
E2 = Sheets("PT").Cells(2, 13).Value <---this equals "Sum of 20134 WAGES"
E3 = Sheets("PT").Cells(3, 13).Value <---this equals "Sum of 20134 EST"
F1 = Sheets("PT").Cells(4, 13).Value <--this is programmed to be the next quarter "Sum of 20141 MAR"
F2 = Sheets("PT").Cells(5, 13).Value <--this is programmed to be the next quarter "Sum of 20141 WAGES"
F3 = Sheets("PT").Cells(6, 13).Value <--this is programmed to be the next quarter "Sum of 20141 EST"

All I need to do now is select the pivot table(PivotTable5), select the older data field (i.e. "Sum of " & E1) and replace the caption and the datafield with "Sum of " & F1. I hope this makes sense.
Any help would be most ...helpful :biggrin:
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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