PDA

View Full Version : [SOLVED:] PivotTable copy certain sections and paste to another sheet



ashleyuk1984
11-25-2014, 04:38 PM
Hi,
This is what my pivot table looks like.

http://www.ultraimg.com/images/Capture3cf76.png

I want to copy certain sections of the table and paste them onto different sheets.
The "Row Labels" will either have one or two options... No more. "1000001" and "3171000". Sometimes it might have just one or the other. Most of the time I'll have both, so the solution will need to compensate for that.

Ideally, I need to copy the columns individually, so that I can paste them into the correct columns on the different sheets.

For instance:

http://www.ultraimg.com/images/Capture59c8f.png

As you can see, this data is under "1000001", so the code will need to know this, and copy this data to sheet 2 (the data for 1000001)
The same will need to be done for the columns next to it.

http://www.ultraimg.com/images/Capture686b2.png http://www.ultraimg.com/images/Capture4fd84.png http://www.ultraimg.com/images/Captureb7cd3.png

No headings or totals are required, just the data from the table.

The same will need to be done for the data under 3171000, and this data will need to be copied to sheet 3

I hope this makes sense.

mancubus
11-26-2014, 12:58 AM
hey.

this is a good resource for pivot table ranges.

http://peltiertech.com/referencing-pivot-table-ranges-in-vba/

ashleyuk1984
11-26-2014, 02:29 AM
hey.

this is a good resource for pivot table ranges.

http://peltiertech.com/referencing-pivot-table-ranges-in-vba/

Thanks, I've favorited that website. With a bit of modification with the codes on that website, I managed to achieve what I needed.

mancubus
11-26-2014, 02:46 AM
you're welcome.
it's in my first-aid kit when i have a chart and pivot VBA related headache. :)