View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Howard Brody Howard Brody is offline
external usenet poster
 
Posts: 1
Default Turning Off AutoFilter With Code

Thanks!

-----Original Message-----
If ActiveSheet.AutofilterMode then
Activesheet.AutofilterMode = False
End if


However, this does not cause an error if the autofilter

is not on, so you
might just execut it without checking

Activesheet.Autofiltermode = False


--
Regards,
Tom Ogilvy


"Howard Brody" wrote in message
...
I am trying to set criteria in a macro can't find the
correct syntax. I want the macro to see if the

AutoFilter
is active and run code to turn it off if it is.

"If Selection.AutoFilter = True" works if an item has

been
selected in the AutoFilter but not if it's on with

nothing
selected yet.

"Selection.AutoFilter" looks like it resets the
AutoFilter, keeping it on but removing any specific
selections.

How can I check if it's active (whether or not specific
criteria has been selected) and turn it completely off

if
it is? Any help would be greatly appreciated.

Thanks in advance!

Howard Brody



.