#1   Report Post  
Kirk P.
 
Posts: n/a
Default Pivot Table ??

I've got a pivot table, one on each sheet. Both pivot tables display similar
information, but in slightly different ways. Question is, can I set it up so
BOTH pivot tables respond to changes in the "page" dimension of one pivot
table.

It would be nice to change the "Year" dimension in PT1 and have that year
carry across to PT2. Currently, I have to change the year in BOTH pivot
tables manually.

Any ideas?
  #2   Report Post  
CyberTaz
 
Posts: n/a
Default

You may be able to do this with a Macro or VBA, but, AFAIK there is no Pivot
Table feature that allows you to "synchronize" separate Pivot Tables. |:)

"Kirk P." wrote:

I've got a pivot table, one on each sheet. Both pivot tables display similar
information, but in slightly different ways. Question is, can I set it up so
BOTH pivot tables respond to changes in the "page" dimension of one pivot
table.

It would be nice to change the "Year" dimension in PT1 and have that year
carry across to PT2. Currently, I have to change the year in BOTH pivot
tables manually.

Any ideas?

  #3   Report Post  
Debra Dalgleish
 
Posts: n/a
Default

The following code is adapted from a posting by Robert Rosenberg. It
changes the second Pivot Table if the page is changed on the first PT.
You could revise it to suit your layout. As noted in the code, place the
code on the module for the worksheet which contains the Pivot Table
(right-click the sheet tab, choose View Code).

Dim mvPivotPageValue As Variant

Private Sub Worksheet_Calculate()
'by Robert Rosenberg 2000/01/11
''I use a module level variable to keep track of
''the last selection from the Page Field.
''This routine was place in the Worksheet
''containing the PivotTable's code module.
Dim pvt As PivotTable
Dim pvt2 As PivotTable

Set pvt = Me.PivotTables(1)
Set pvt2 = Sheets("OtherPivot").PivotTables(1)
If LCase(pvt.PivotFields("Customer").CurrentPage) _
< LCase(mvPivotPageValue) Then
'The Page Field was changed
Application.EnableEvents = False
pvt.RefreshTable
mvPivotPageValue = _
pvt.PivotFields("Customer").CurrentPage
pvt2.PageFields("Customer").CurrentPage _
= mvPivotPageValue
Application.EnableEvents = True
End If

End Sub


Kirk P. wrote:
I've got a pivot table, one on each sheet. Both pivot tables display similar
information, but in slightly different ways. Question is, can I set it up so
BOTH pivot tables respond to changes in the "page" dimension of one pivot
table.

It would be nice to change the "Year" dimension in PT1 and have that year
carry across to PT2. Currently, I have to change the year in BOTH pivot
tables manually.

Any ideas?



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

  #4   Report Post  
Kirk P.
 
Posts: n/a
Default

That's what I'm looking for - Thanks!

"Debra Dalgleish" wrote:

The following code is adapted from a posting by Robert Rosenberg. It
changes the second Pivot Table if the page is changed on the first PT.
You could revise it to suit your layout. As noted in the code, place the
code on the module for the worksheet which contains the Pivot Table
(right-click the sheet tab, choose View Code).

Dim mvPivotPageValue As Variant

Private Sub Worksheet_Calculate()
'by Robert Rosenberg 2000/01/11
''I use a module level variable to keep track of
''the last selection from the Page Field.
''This routine was place in the Worksheet
''containing the PivotTable's code module.
Dim pvt As PivotTable
Dim pvt2 As PivotTable

Set pvt = Me.PivotTables(1)
Set pvt2 = Sheets("OtherPivot").PivotTables(1)
If LCase(pvt.PivotFields("Customer").CurrentPage) _
< LCase(mvPivotPageValue) Then
'The Page Field was changed
Application.EnableEvents = False
pvt.RefreshTable
mvPivotPageValue = _
pvt.PivotFields("Customer").CurrentPage
pvt2.PageFields("Customer").CurrentPage _
= mvPivotPageValue
Application.EnableEvents = True
End If

End Sub


Kirk P. wrote:
I've got a pivot table, one on each sheet. Both pivot tables display similar
information, but in slightly different ways. Question is, can I set it up so
BOTH pivot tables respond to changes in the "page" dimension of one pivot
table.

It would be nice to change the "Year" dimension in PT1 and have that year
carry across to PT2. Currently, I have to change the year in BOTH pivot
tables manually.

Any ideas?



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using a Pivot Table Calculated Field to get a Unique Count Mike Struckman Excel Worksheet Functions 1 November 22nd 05 05:32 PM
pivot table yllee70 Excel Worksheet Functions 1 February 21st 05 10:49 PM
Removing errors from a Pivot table Mighty Magpie Excel Discussion (Misc queries) 2 February 3rd 05 03:15 PM
Pivot Table services Craig Excel Discussion (Misc queries) 5 January 19th 05 06:11 PM
Problem with Pivot Table Drop-Down Menus Mac Excel Worksheet Functions 4 November 7th 04 01:18 PM


All times are GMT +1. The time now is 10:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"