Manoj Gaidhankar
New Member
- Joined
- May 27, 2022
- Messages
- 20
- Office Version
- 2021
- Platform
- Windows
I need a code which selects the column and displays the Filter box as shown in the below image("This is a filter dropdown which allows us to select the list of values").
I want a code which follows the following steps
1) Select column A
2) Prompts us the Filter box as shown in the below picture for us to manually select the data
3) Later, Run the rest part of the code
I have a code already in place but its prompts for an Input box with the values("Manually") to be entered in it. But this is not the one which I want.
Please find the below reference image and the code as-well.
Sub Filer_Box()
Dim uiDeptToShow As String
uiDeptToShow = Application.InputBox("Show which Department", Type:=2)
If uiDeptToShow = "False" Then Exit Sub: Rem Cancel pressed
Range("A1:M1").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="=" & uiDeptToShow, Operator:=xlAnd
End Sub
I want a code which follows the following steps
1) Select column A
2) Prompts us the Filter box as shown in the below picture for us to manually select the data
3) Later, Run the rest part of the code
I have a code already in place but its prompts for an Input box with the values("Manually") to be entered in it. But this is not the one which I want.
Please find the below reference image and the code as-well.
Sub Filer_Box()
Dim uiDeptToShow As String
uiDeptToShow = Application.InputBox("Show which Department", Type:=2)
If uiDeptToShow = "False" Then Exit Sub: Rem Cancel pressed
Range("A1:M1").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="=" & uiDeptToShow, Operator:=xlAnd
End Sub