Archive of Mr Excel Message Board


Back to Data in Excel archive index
Back to archive home

Autofilter code

Posted by Paul Magruder on February 28, 2001 11:30 AM
Is there code that maks sure the autofilters are off?
I know
Selection.Autofilter ...turns them on, and the next time... Selection.Autofilter ...turns them off, but
I need to make sure the filters are off when exiting a worksheet no matter if they were left on or off by the previous person that used the database.

Thanks in advance
Paul Magruder


Re: Autofilter code

Posted by Marcie on February 28, 2001 11:42 AM
This works for me:

If Worksheets("Sheet1").AutoFilterMode = True Then
Selection.AutoFilter ' to turn it off
End If


Re: Thanks..........Autofilter Code

Posted by Paul Magruder on February 28, 2001 11:55 AM
Just what I needed.... Thanks

Paul


This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our online store to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.