Checking if autofilter is on?

S

SOS

Hi there,

From a search of previous posts I found the code:

activesheet.autofiltermode = false

to switch off autofilter is it has been applied. This is good but
would like to cycle round ALL sheet in the workbook and apply that lin
of code.

I tried

Sub Test
For each Sheet in ActiveWorkbook
Sheet.AutofilterMode = False
Next Sheet
End Sub

and also Sheet*s*.AutoFilterMode = False

but neither worked.

Hope somebody can help

TIA

Seamu
 
N

Norman Jones

Hi Seamus,

Sub Test()
Dim sh As Worksheet

For Each sh In ActiveWorkbook.Worksheets
sh.AutoFilterMode = False
Next
End Sub
 
R

RB Smissaert

Sub test()

Dim sh As Worksheet

For Each sh In ActiveWorkbook.Sheets
sh.AutoFilterMode = False
Next

End Sub


RBS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top