This feels like a dumb question, but will all of my Googling, I can't figure it out. I am writing a few VBA scripts to aid in quickly filtering some pivot tables.
Let's say I have a pivot table containing some standard sales data. One of the "Report Filter" fields is "State".
I have figured out how to show a single state:
Dim pt As PivotTable
Set pt = Sheets("Sales").PivotTables("SalesPivot")
pt.ClearAllFilters
pt.PivotFields("State").CurrentPage = "Oregon"
The above works well. But how would I do the exact same thing except showing "Oregon" and "California"? (Also, if there is a better way to do the above, I'm all ears)
By hand, I would first check the "select multiple items" box, then uncheck the "(All)" option to select none, then scroll through the options to find and check "California" and "Oregon", and then click OK.
Thanks!