Connection Between Two Pivot Tables

bliang

New Member
Joined
Oct 8, 2002
Messages
2
I have this problem for many years and need a big help! I have two pivot tables with identical page views. They are not using the same data source. What I need is whenever I select one page in one pivot table, anther pivot table will automatically select the same page. Is it possible by using VBA?

Thanks in advance.

Bliang
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Juan Pablo González

MrExcel MVP
Joined
Feb 8, 2002
Messages
11,959
Yes, it's possible.

I used the change event of the worksheet, something like this:

<pre>Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Target.Address = "$B$1" Then 'Changed pagefield of PivotTable 1
Range("K1").PivotTable.PageFields(1).CurrentPage = Target.Value 'Update PT 2
ElseIf Target.Address = "$K$1" Then 'Changed pagefield of PivotTable 2
Range("B1").PivotTable.PageFields(1).CurrentPage = Target.Value 'Update PT 1
End If
Application.EnableEvents = True
End Sub</pre>This example assumes that both PT's are on the same worksheet, but, that can be adjusted.
 

bliang

New Member
Joined
Oct 8, 2002
Messages
2
Thanks for the help. However, after I copy your code, it is still not working.

Please advise it.

Bliang
 

Forum statistics

Threads
1,144,358
Messages
5,723,891
Members
422,524
Latest member
wirkkarn

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top