Peter-Jan De Smedt
New Member
Hi
Can you add a label filter to a report filter in a pivot table?
I'm trying to use a wild card to retrieve the top 10 for for example "????A".
The input "????A" would come from a cell in another sheet.
So far I managed to get below code
Sub wildcard()
'
' wildcard Macro
'
'
ActiveSheet.PivotTables("PivotTable2").PivotFields("Key").ClearAllFilters
ActiveSheet.PivotTables("PivotTable2").PivotFields("Key").PivotFilters.Add _
Type:=xlCaptionEndsWith, Value1:="???MB"
End Sub
If I can get "???MB" or any other combination taken from the cell in another sheet and use it in the report filter instead of the row labels the problem would be solved.
Any help would be much appreciated!
Can you add a label filter to a report filter in a pivot table?
I'm trying to use a wild card to retrieve the top 10 for for example "????A".
The input "????A" would come from a cell in another sheet.
So far I managed to get below code
Sub wildcard()
'
' wildcard Macro
'
'
ActiveSheet.PivotTables("PivotTable2").PivotFields("Key").ClearAllFilters
ActiveSheet.PivotTables("PivotTable2").PivotFields("Key").PivotFilters.Add _
Type:=xlCaptionEndsWith, Value1:="???MB"
End Sub
If I can get "???MB" or any other combination taken from the cell in another sheet and use it in the report filter instead of the row labels the problem would be solved.
Any help would be much appreciated!