Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Linking Page Fields for multiple pivot tables
I'm using the following code to set the page field for PivotTable2
based on whatever it's set as in PivotTable1: Code: Sub SetPagefield() Application.ScreenUpdating = False Dim pfld As PivotField Dim Pi As PivotItem Dim Target As Range Set Target = Worksheets("Chris").Range("B3") If IsEmpty(Target.Value) Then Exit Sub Set pfld = Worksheets("Chris").PivotTables _ ("PivotTable2").PageFields( _ "Month") For Each Pi In pfld.PivotItems If Pi.Value = Target.Text Then pfld.CurrentPage = Pi.Value Exit For End If Next Application.ScreenUpdating = True End Sub The page fields in question contain month names (January, August etc), and the code works for these, but doesn't work when I select (All) from PivotTable1. What am I doing wrong? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Linking Page Fields for multiple pivot tables
Excel 2007 PivotTable
Match page field item selection of multiple PTs. http://c0718892.cdn.cloudfiles.racks.../04_10_10.xlsm |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Linking Page Fields for multiple pivot tables
On Apr 17, 9:57*am, Herbert Seidenberg
wrote: Excel 2007 PivotTable Matchpagefielditem selection of multiple PTs.http://c0718892.cdn.cloudfiles.racks.../04_10_10.xlsm Hello Herbert, Many thanks for posting the link - that's exactly what I want. However, I'm using the code in Excel 2003, and I still can't get it to work when I select (All) from the page field - I get a the following error: Run-time Error '1004 Unable to set the Visible property of the PivotItem class Each month is working perfectly though if I select them individually. Any ideas? Thanks again for your help! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to Synchronize page fields for two or more than 2 pivot tables? | Excel Programming | |||
Debra Dalgleish - Pivot Tables (Change Multiple Page Fields) | Excel Programming | |||
Change Multiple Page Fields in two independent Pivot Tables | Excel Worksheet Functions | |||
linking pivot tables by page fields | Excel Programming | |||
Filtering or linking Page Fields in an Excel Pivot Table | Excel Programming |