PDA

View Full Version : Solved: Test if Autofilter is on



Djblois
04-13-2007, 12:19 PM
I was wondering if there was a way to test if the autofilter is on?

I tried

If cells.autofilter then
cells.autofilter
end if

If it is on, I want to turn it off

stanl
04-13-2007, 12:38 PM
something like

Sub ToggleFilter()
If Not ActiveSheet.AutoFilterMode Then
ActiveSheet.Range("A1").AutoFilter
Else
ActiveSheet.AutofilterMode = False
End If
End SubStan

Djblois
04-13-2007, 01:01 PM
that worked perfectly