Solved

One report filter for multiple worksheets

Posted on 2011-03-01
1
509 Views
Last Modified: 2012-08-14
I'm trying to find a way to use report filters for a pivot table in one worksheet and apply the same filters to 5 other worksheets in the workbook that contain similar data. In other words, when I select the report parameters (customerID,start date, end date) I want the pivot tables on the remaining worksheets to use the same parameters to populate the corresponding pivot tables and charts.  I'm using Excel 2007/Windows.
0
Comment
Question by:Ed_CLP
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 9

Accepted Solution

by:
hitsdoshi1 earned 500 total points
ID: 35011688
For eg...on Sheet1 is:
A1: CustomerID
A2: StartDate
A3: End Date

And you have Pivots on Sheet2, Sheet3, Sheet4 and so on.....

Following code will do the job...


Sub UpdatePivots()
Sheets("Sheet2").PivotTables("Pivot1").PivotFields("CustID").CurrentPage = Sheets("Sheet1").Range("A1").Value
Sheets("Sheet3").PivotTables("Pivot2").PivotFields("CustID").CurrentPage = Sheets("Sheet1").Range("A1").Value
Sheets("Sheet4").PivotTables("Pivot3").PivotFields("CustID").CurrentPage = Sheets("Sheet1").Range("A1").Value

Sheets("Sheet2").PivotTables("Pivot1").PivotFields("StartDt").CurrentPage = Sheets("Sheet1").Range("A2").Value

And so on...

Open in new window

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question