Dear Sirs,
I have the following macro to add filter on current_worksheet at predefined range provided by Don at the following link https://www.teachexcel.com/talk/2950/add-filters-on-selected-sheets-at-once#topic_answer_section_anchor.
The macro it self is working perfectly. In this macro the range already defined as below
Set Rng = Range(.Cells(3, 1), .Cells(3, .UsedRange.Columns.Count))
I want to have the modified macro that defined the range based on an input box (Default range Range(.Cells(3, 1), .Cells(3, .UsedRange.Columns.Count))
Looking forward to having your further advice in this regards
Best regards
Arsil Hadjar
Sub AddFilter_on_Current_Worksheet()
Dim Sh As Worksheet
Dim Rng As Range
Application.ScreenUpdating = False ' stop screen flicker
Set Sh = ActiveSheet
With Sh
If .AutoFilterMode Then .AutoFilterMode = False
Set Rng = Range(.Cells(3, 1), .Cells(3, .UsedRange.Columns.Count))
Rng.AutoFilter
.Activate
.Range("J4").Select
End With
With ActiveWindow
If .FreezePanes Then .FreezePanes = False
.FreezePanes = True
End With
Application.ScreenUpdating = True
End Sub
[/CODE]