A
Agustus
Hi,
I have a macro below to turn the autofilter "on" for multiple selected
sheets but it generated error. Please advise.
Sub auto_filter_all_sheets()
Dim ws As Worksheet
Application.ScreenUpdating = False
sAddress = Selection.Address
For Each ws In ActiveWindow.SelectedSheets
ws.Activate
If sAddress > "" Then ws.Range(sAddress).Select
Selection.AutoFilter
Next ws
Application.ScreenUpdating = True
End Sub
TIA.
I have a macro below to turn the autofilter "on" for multiple selected
sheets but it generated error. Please advise.
Sub auto_filter_all_sheets()
Dim ws As Worksheet
Application.ScreenUpdating = False
sAddress = Selection.Address
For Each ws In ActiveWindow.SelectedSheets
ws.Activate
If sAddress > "" Then ws.Range(sAddress).Select
Selection.AutoFilter
Next ws
Application.ScreenUpdating = True
End Sub
TIA.