jcaptchaos2
Well-known Member
- Joined
- Sep 24, 2002
- Messages
- 1,032
- Office Version
- 365
- Platform
- Windows
i am trying to make it so a user can type something in a cell press a macro button and the pivot table will filter for that word. I can do it manually by selecting the drop down, selecting label filters and typing my search word in. I want the user to be able to type the search word in cell B1 hit the button and it does that for them I have this but don't know how to get it to look at what's typed in the cell. Is it possible to do this?
Code:
Sub bllookup()
'
' bllookup Macro
'
'
Range("B1").Select
Application.CutCopyMode = False
Selection.Copy
ActiveSheet.PivotTables("PivotTable2").PivotFields("Description").PivotFilters. _
Add Type:=xlCaptionContains, Value1:=("B1")
Range("F1").Select
End Sub