ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy Pivot Table Data and Paste into New File (https://www.excelbanter.com/excel-programming/345620-copy-pivot-table-data-paste-into-new-file.html)

S Sainsbury

Copy Pivot Table Data and Paste into New File
 
I have a spreadsheet with a pivot table, the table basically lists orders
placed by customers. What I need to do is filter the pivot table so that
only orders for a particular customer shows i.e untick "show all" and only
select the customer I wish to view, then copy the data and insert/paste it
into a new excel file. This process then needs to be repeated for each
customer in the filter list.

I have managed to do the above using a macro, however the filter list that
shows the customer names will change often so the macro is only of any use if
the customers never change, so what I need is a script that can do all of the
above but also go through the filter list from start to end regardless of how
many entries there may be or if they have changed.

Can anyone help me? I can supply the excel file and/or screenshots.

Thank you.

Tom Ogilvy

Copy Pivot Table Data and Paste into New File
 
To loop throught the list of customers use something like
for each itm in
activesheet.PivotTables(1).PivotFields("Customer") .PivotItems



Next

See Debra Dalgleish's site for hints on working with Pivot Tables, including
using code.

http://www.contextures.com/tiptech.html

--
Regards,
Tom Ogilvy



"S Sainsbury" wrote in message
...
I have a spreadsheet with a pivot table, the table basically lists orders
placed by customers. What I need to do is filter the pivot table so that
only orders for a particular customer shows i.e untick "show all" and only
select the customer I wish to view, then copy the data and insert/paste it
into a new excel file. This process then needs to be repeated for each
customer in the filter list.

I have managed to do the above using a macro, however the filter list that
shows the customer names will change often so the macro is only of any use

if
the customers never change, so what I need is a script that can do all of

the
above but also go through the filter list from start to end regardless of

how
many entries there may be or if they have changed.

Can anyone help me? I can supply the excel file and/or screenshots.

Thank you.





All times are GMT +1. The time now is 06:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com