Hello,

I would like to create a macro which would turn off filters in a specified sheets.
I manged to come up with something like this:

Sub Macro2()

Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
With ws
If Not .Name Like "XXX" And Not .Name Like "XXX2" And Not .Name Like "XXX3" And Not .Name Like "XXX4" Then
Cells.Select
Selection.AutoFilter
End If

End With

Next

End Sub
It doesn't work . Macro is turning filters on and off in active sheet.

Any help would be appreciated.