Hi Everyone,
Is it possible to filter a PivotTable field using a "contains" keyword from another cell?
I tried recording a macro and got results below:
-----------------
Sub CatFilter()
'
' CatFilter Macro
'
'
ActiveSheet.PivotTables("PivotTable6").PivotFields("Category"). _
ClearLabelFilters
ActiveSheet.PivotTables("PivotTable6").PivotFields("Category").PivotFilters. _
Add Type:=xlCaptionContains, Value1:="Green"
End Sub
------------
I'd like to replace Value1:="Green" to reference by cell G25 where the keyword is listed. Below is a screenshot of what I attempting to do.
Thank you in advance for your help!!!
Is it possible to filter a PivotTable field using a "contains" keyword from another cell?
I tried recording a macro and got results below:
-----------------
Sub CatFilter()
'
' CatFilter Macro
'
'
ActiveSheet.PivotTables("PivotTable6").PivotFields("Category"). _
ClearLabelFilters
ActiveSheet.PivotTables("PivotTable6").PivotFields("Category").PivotFilters. _
Add Type:=xlCaptionContains, Value1:="Green"
End Sub
------------
I'd like to replace Value1:="Green" to reference by cell G25 where the keyword is listed. Below is a screenshot of what I attempting to do.
Thank you in advance for your help!!!