#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default AutoFilter

How, by code, can I check if autofilter is on?

If it is on, switch it off.

Thanks in advance.

Gareth
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default AutoFilter

if Activesheet.AutofilterMode then
Activesheet.AutofilterMode = False
End if

Note that you can not set this property to True to turn on the Autofilter.

--
Regards,
Tom Ogilvy

"Gareth" wrote in message
...
How, by code, can I check if autofilter is on?

If it is on, switch it off.

Thanks in advance.

Gareth



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default AutoFilter

Get rid of the arrows????
ActiveSheet.AutoFilterMode = False
It won't hurt if the sheet doesn't have autofilter applied.

Keep the arrows, but show all the data???

With ActiveSheet
If .AutoFilterMode Then
If .FilterMode Then
.ShowAllData
End If
End If
End With





Gareth wrote:

How, by code, can I check if autofilter is on?

If it is on, switch it off.

Thanks in advance.

Gareth


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default AutoFilter

Hi Gareth

Dim rng As Range
On Error Resume Next
Set rng = ActiveSheet.AutoFilter.Range
On Error GoTo 0
If Not rng Is Nothing Then
rng.AutoFilter
End If

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Gareth" wrote in message
...
How, by code, can I check if autofilter is on?

If it is on, switch it off.

Thanks in advance.

Gareth



Reply
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 2007 autofilter change to 2003 autofilter functionality? jonnybrovo815 Excel Discussion (Misc queries) 1 April 19th 10 10:05 PM
2007 excel autofilter back to 2003 autofilter? jonnybrovo815 Excel Discussion (Misc queries) 3 April 19th 10 08:11 PM
2007 excel autofilter change back to 2003 autofilter? jonnybrovo815 Excel Discussion (Misc queries) 1 April 19th 10 05:53 PM
2007 Autofilter worse than 2003 Autofilter jsky Excel Discussion (Misc queries) 9 October 31st 07 12:14 AM
How to Sort within AutoFilter with Protection on (and AutoFilter . giblon Excel Discussion (Misc queries) 1 February 16th 06 12:23 PM


All times are GMT +1. The time now is 10:22 AM.

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

About Us

"It's about Microsoft Excel"