amrita17170909
Board Regular
- Joined
- Dec 11, 2019
- Messages
- 74
- Office Version
- 2019
- 2016
- 2013
- Platform
- Windows
Hi All,
I am trying to build a code which will accept a user input for the filter.
So for example if userinput = 10,000 the code is going to only show the values over 10,000.
I also want the range to be dynamic but I am not sure how to incorporate that
Sub AutoFilter_range()
'Filter to show values over 10 Million
Application.ScreenUpdating = False
'Dim Range_to_filter As Range
'Dim UserInputValue As Long
UserInputValue = InputBox("Please enter value in millions.", , 10)
Set Range_to_filter = Range("F6:f178")
Range_to_filter.AutoFilter Field:=6, Criteria1:="UserInputvalue"
Application.ScreenUpdating = True
End Sub
I am trying to build a code which will accept a user input for the filter.
So for example if userinput = 10,000 the code is going to only show the values over 10,000.
I also want the range to be dynamic but I am not sure how to incorporate that
Sub AutoFilter_range()
'Filter to show values over 10 Million
Application.ScreenUpdating = False
'Dim Range_to_filter As Range
'Dim UserInputValue As Long
UserInputValue = InputBox("Please enter value in millions.", , 10)
Set Range_to_filter = Range("F6:f178")
Range_to_filter.AutoFilter Field:=6, Criteria1:="UserInputvalue"
Application.ScreenUpdating = True
End Sub