Hi
In the sample code below, I am using the data from cell C3 ( a drop down list) as a filter value. This works OK if the value in C3 matches an item in the filter list. However if the data in C3 does not match any of the filter items in the pivot field filter list, a VBA error is generated (understandably). How can I check the filter options available in the filter list and then generate an error msgbox if there is no match.
Note I specifically do not want the user to have search each pivot table in my workbook manually.
ActiveSheet.PivotTables("PivotTable4").PivotFields("Inclusion").ClearAllFilters
ActiveSheet.PivotTables("PivotTable4").PivotFields("Inclusion").CurrentPage = Range("C3").Value
ActiveSheet.PivotTables("PivotTable4").PivotCache.Refresh
Thanks
Bookmarks