Master Filter for Pivot Tables

forrestgump

New Member
Joined
Sep 30, 2010
Messages
22
Hi All,

I am trying to create a master filter on the 1st sheet of an excel workbook so that when I change the first filter it changes all the pivot tables. I am currently using the following vba code:-

<!-- BEGIN TEMPLATE: bbcode_code -->VBA:

Public Sub Update_PTs() Dim PT As PivotTable, ws As Worksheet Dim vChoice: vChoice = Sheets("MASTER").Range("A1") For Each ws In ThisWorkbook.Worksheets For Each PT In ws.PivotTables PT.PageFields(1).CurrentPage = vChoice Next PT Next ws End Sub
</PRE>
<!-- END TEMPLATE: bbcode_code -->
However, when I use this code I get run time error 1004 and the code stops at line "PT.PageFields(1).CurrentPage = vChoice".

How can I fix this?

Regards,

ForrestGump
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Hi,

Questions:
Do you have PivotTables in all sheets?
Sheets("MASTER").Range("A1") value is valid for all PivotTables?

M.
 
Upvote 0

Forum statistics

Threads
1,224,605
Messages
6,179,860
Members
452,948
Latest member
UsmanAli786

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