A problem that has been trapped for a long time has finally been solved. The requirement is that there are many pivot tables in Excel, the data source for each pivot table is the same, and I want to have one of these pivot tables linked together.
For example, I have three pivot tables, and I want to change the month option for three tables to "2014-12". Check to find can only be implemented in VBA.
The specific code is as follows:
Public Subfilterpivottable ()Dimorgorg= ActiveSheet.PivotTables ("Pivot Table 6"). PivotFields ("[Branch_dbvin]. [OrgName]. [OrgName]"). CurrentPageName withActiveSheet.PivotTables ("Pivot Table"). PivotFields ("[Branch_dbvin]. [OrgName]. [OrgName]") . CurrentPageName=ORGEnd withEnd Sub
In this case, "pivot Table 6" is the source data, and the variable org stores the results to be changed. Pivot Table 12 is the target pivot table.
Using VBA to control the implementation of multiple pivot tables (pivot table) in Excel