using getpivotdata in VBA

lampshade

New Member
Joined
Oct 22, 2010
Messages
3
I'm looking for a code to extract entries out of a pivot table and put them in a new table. I'd like to be able to fill every cell in the new table.

I have used getpivotdata manually in Excel and it works fine. When I try to record it as a macro things get complicated.

Once I have it working as a macro I need to fill down to the last row in the table and across to the last column. The rows and column titles correspond to the titles in the pivot table so I'd like to just use the cell references (like $a2 and b$1) instead of the row/column titles in the formula so it can apply to all cells in the table.

A particular question from all of this would be: How can I translate a GETPIVOTDATA excel formula into VBA?

And once I've done that, how can I get it to apply down to the last rowna d across to the las column?
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

Forum statistics

Threads
1,223,275
Messages
6,171,123
Members
452,381
Latest member
Nova88

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