jski21
Board Regular
- Joined
- Jan 2, 2019
- Messages
- 155
- Office Version
- 2016
- Platform
- Windows
Good day Mr. Excel Team,
Is there a way through VBA to enter specific text into a PivotTable filter? I'm seeking to enter the search criteria "CR,7008*" into a PivotTable Filter. The search criteria will always be "CR,7008*". I thought recording this would reveal the operation but it doesn't. It simply lists all the excluded entries in the current dataset as False. The CR,7008 data will change from month to month so simply recording the macro and using the resulting code will not work on subsequent months as the code bombs off when it attempts to run through the previous month's excluded entries and can't find them. I then have to manually go into the search filter, check the Select Multiple Items box, and enter CR,7008* in the search criteria field to get the filter to operate properly against the new dataset.
Hope this makes a bit of sense. I'm starting the above code like this:
ActiveSheet.PivotTables("PivotPark").PivotFields("Journall ID").CurrentPage = _
"(All)"
ActiveSheet.PivotTables("PivotPark").PivotFields("Journall ID"). _
EnableMultiplePageItems = True
Thanks in advance for your guidance.
jski
Is there a way through VBA to enter specific text into a PivotTable filter? I'm seeking to enter the search criteria "CR,7008*" into a PivotTable Filter. The search criteria will always be "CR,7008*". I thought recording this would reveal the operation but it doesn't. It simply lists all the excluded entries in the current dataset as False. The CR,7008 data will change from month to month so simply recording the macro and using the resulting code will not work on subsequent months as the code bombs off when it attempts to run through the previous month's excluded entries and can't find them. I then have to manually go into the search filter, check the Select Multiple Items box, and enter CR,7008* in the search criteria field to get the filter to operate properly against the new dataset.
Hope this makes a bit of sense. I'm starting the above code like this:
ActiveSheet.PivotTables("PivotPark").PivotFields("Journall ID").CurrentPage = _
"(All)"
ActiveSheet.PivotTables("PivotPark").PivotFields("Journall ID"). _
EnableMultiplePageItems = True
Thanks in advance for your guidance.
jski