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

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

Forum statistics

Threads
1,214,975
Messages
6,122,538
Members
449,088
Latest member
RandomExceller01

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