I have a workbook containing of several pivot tables. All the pivot tables get the have the same data source. I have one worksheet called Pivot where i have my main pivot table. When i change the Pagefield in this "Master pivot" it change all the pagefields throughout the workbook.
I want all the pivot tables to have the same data columns as my "Master pivot", so when i add an extra datafield in the "Master pivot" like Sum of 2010 all the other pivot tables should have this column too.
I have been able to get the data fields added to the other pivot tables with this code:
But there is a problem with that code since it doesnt clear all datafields before it adds the new. I have tried to use .Orientation = xlHidden but i get an error every timeFor i = 1 To Sheets("Pivot").PivotTables("PivotTable1").DataFields.count
Sheets("Energy pivot").PivotTables("PivotTable3").AddDataField Sheets("Energy pivot").PivotTables("PivotTable3").PivotFields(Mid(Sheets("Pivot").PivotTables("PivotTable1").DataFields(i).Name, 8, 6))
'Several other pivot tables are changed in the same way
Next
Can any please help me how to solve this question?
Bookmarks