Linking pivot tables across worksheets

voodoo.mutt

New Member
Joined
Jul 14, 2011
Messages
5
Hi

I would like to link two (or more) pivot tables that are sitting on individual worksheets. The datasets are separate however they share a common pagefield.

So if I change the filter in Pivot Table 1 on Worksheet One to "Apples" then I'd to see Pivot Table 2 on Worksheet Two also change it's filter to "Apples" and refresh accordingly.

I've found VB code for syncing pagefields for pivot tables sharing the same worksheet but nothing across worksheets.

Any ideas?

Thanks in anticipation.
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
If you are using Excel 2010 then you can use a slicer to filter all pivot tables using a common pivot cache. Just create your slicer and then add any other tables under its "Pivot table connections" setting.
 
Upvote 0
hi, here is the code which works for two pivots on one worksheet

Private Sub Worksheet_Calculate()
Dim PF1 As PivotField
Dim PF2 As PivotField
Dim x As String
Application.EnableEvents = False
Application.ScreenUpdating = False
Set PF1 = ActiveSheet.PivotTables("<wbr>PivotTable1").PageFields(1)
Set PF2 = ActiveSheet.PivotTables("<wbr>PivotTable2").PageFields(1)
x = PF1.CurrentPage
PF2.CurrentPage = x
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub

thank you
 
Upvote 0

Forum statistics

Threads
1,224,559
Messages
6,179,513
Members
452,921
Latest member
BBQKING

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
Back
Top