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:
<!-- 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
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