ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   AutoFilter (https://www.excelbanter.com/excel-programming/327802-autofilter.html)

gareth

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

If it is on, switch it off.

Thanks in advance.

Gareth

Tom Ogilvy

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




Dave Peterson[_5_]

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

Bob Phillips[_6_]

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





All times are GMT +1. The time now is 08:01 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com