Jinjunwei
New Member
- Joined
- Jun 12, 2005
- Messages
- 49
Hi,
I made a simple macro that selects a pivot table, adds a filter, and then copies and pastes the output. The problem is that the macro works by selecting the pivot table by name and I have 30 sheets where I'd like to run it BUT the pivot table name is different on each one (even tho the data is exactly the same). Is there a way to wild card select the pivot table on the sheet?
This the part of the macro I need to change:
With ActiveSheet.PivotTables("PivotTable1").PivotFields("Inquiry State")
.Orientation = xlPageField
So, i need it to say something like
With ActiveSheet.PivotTables("PivotTable*.*").PivotFields("Inquiry State")
.Orientation = xlPageField
Any advice on how to do this?
Thank you in advance,
Brian
I made a simple macro that selects a pivot table, adds a filter, and then copies and pastes the output. The problem is that the macro works by selecting the pivot table by name and I have 30 sheets where I'd like to run it BUT the pivot table name is different on each one (even tho the data is exactly the same). Is there a way to wild card select the pivot table on the sheet?
This the part of the macro I need to change:
With ActiveSheet.PivotTables("PivotTable1").PivotFields("Inquiry State")
.Orientation = xlPageField
So, i need it to say something like
With ActiveSheet.PivotTables("PivotTable*.*").PivotFields("Inquiry State")
.Orientation = xlPageField
Any advice on how to do this?
Thank you in advance,
Brian