Using VBA to control the implementation of multiple pivot tables (pivot table) in Excel

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.