• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

vba copying and paste pivot tables fields

Yue Chu

New Member
Hello,

I have a difficult vba question that I need to try and solve and it's kind of specific.
Background:
I have two files. Both source file and target file have multiple tabs with multiple pivot tables on them.
task:
locate all the pivot tables in the source file
for each pivot table I need to extract the row field, column field, data field, filtering and then paste this "pivot table property" into the same pivot table (with same tab name) in the target file. I do not want to copy the entire pivot table because I have charts and formulas running off the target pivot table.

so how easy and possible is it to copy "pivot table properties" to another file and how would a person go about doing it. I am a novice when it comes to vba programming with pivot tables.

thanks,
yue
 
You mean that you don't want entire sheet copied but want all pivot tables copied? Excluding charts and other areas of the sheet.

upload_2015-9-4_15-42-51.png

Or do you mean to copy data displayed on pivot table as data like below image (along with format)?

upload_2015-9-4_15-43-47.png
 
Do all the Pivot Tables fin each file feed of the same source of data?
If so why not extract the data from there directly ?
 
Do all the Pivot Tables fin each file feed of the same source of data?
If so why not extract the data from there directly ?


I'm not looking to do anything with the source data. They will update separately. I want to copy all the properties of a pivot table (row field, column field, data field, filters, etc) from the source file to the target file. I believe there should be a way of identifying those properties in the source file and set the target file pivot table properties to equal that. I just don't know the code for "extracting" the pivot table properties from the source pivot table to apply it to the target pivot table. Any ideas anyone? thanks
 
So you have separate Pivot, you just want to grab settings from one Pivot to the other?

yes. I'm grabbing the settings from one pivot table and putting it in another. so that the target pivot table would resemble the source pivot table. I'm looking for a vba solution though.
 
I saw that link before too. I actually I want to "grab" as much information from the source pivot table as possible (including source data location) and then map it to the target pivot table (the source data location would use an identical worksheet but for target file.) I've seen a number of webpages with varying degrees of help, but I'm trying to get some more specific help. I am not too comfortable working with pivot tables in vba yet.
 
Hmm, can you upload sample? I can't help you with specific code without seeing how your source workbook and destination workbook is set up.
 
Back
Top