LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
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



.

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel vba autofilter code Isis[_2_] Excel Discussion (Misc queries) 0 April 26th 10 05:34 PM
Excel VBA AutoFilter code Isis[_2_] Excel Discussion (Misc queries) 0 April 26th 10 05:31 PM
vba code on autofilter ub Excel Discussion (Misc queries) 1 August 6th 08 08:09 PM
Autofilter code Dominic LeVasseur Excel Discussion (Misc queries) 2 August 16th 06 09:33 PM
VBA code to locate cell address of AutoFilter dropdown box Dennis Excel Discussion (Misc queries) 3 August 9th 05 10:00 PM


All times are GMT +1. The time now is 10:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"