Copying Pivot Tables on to one sheet using VBA

WildfireS3

New Member
Joined
Nov 20, 2009
Messages
11
Hi All

I'm a beginner to VBA, so please be gentle.

I have realsied that I can speed up a lot of my reports by automating them using VBA. However I'm a complete novice.

I have managed to get Excel to kick out 13 pivot tables to indivdual sheets, but now I want to consolidate these into one sheet.

I would like to copy the pivot table from each sheet, place it on to a new sheet, count 6 cells down then paste the next one in. So I end up with a master sheet with all 13 pivot tables on it.


Any takers?

Thanks
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Hi Adam

That would be good, but I'm not sure how to get Excel to find the last cell, in the last pivot table on the sheet, count 6 cells down then create the new pivot table.

Thanks
 
Upvote 0
You can use the PivotTable's TableRange2 property like this:

Code:
Sub Test()
    With ActiveSheet.PivotTables(1).TableRange2
        MsgBox .Cells(.Rows.Count, 1).Address
    End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,919
Messages
6,122,260
Members
449,075
Latest member
staticfluids

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