Dear Sirs,
I have the following macro suggested by Variatus to add filter for all worksheets
Refer to link below on 28 May 2018
'https://www.teachexcel.com/talk/2740/add-filters-on-all-worksheets#topic_answer_section_anchor
I need the help in modifying macro to select the range for Autofilter by inputbox with the default of Rows("3:3")
Looking forward to having your further advice in this regards
Best regards
Arsil Hadjar
Sub AddFilter_on_allWorksheet()
' Hello Arsil,
'The AutoFilter method is a toggle.
'Every time it is called it will change to the opposite of what it was.
'To avoid surprises use the AutoFilterMode to determine the current status.
Dim Sh As Worksheet
Dim Rng As Range
Application.ScreenUpdating = False ' stop screen flicker
For Each Sh In Worksheets
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
Next Sh
Application.ScreenUpdating = True
End Sub