Solved

One report filter for multiple worksheets

Posted on 2011-03-01
1
503 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
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

831 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