ExcelBanter

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

LD[_2_]

Autofilter
 
Hi all.

Is there some way to determine if the autofilter is on?

I have a button to display all data, but i want to exit the sub
if the data is not filtered.

Hope you understand what i'm trying to say.

Thanx in advance.



Rob van Gelder[_4_]

Autofilter
 
LD,

Sub testit()
If Not Worksheets(1).AutoFilterMode Then Exit Sub
MsgBox "Autofilter is active"
End Sub

Rob

"LD" wrote in message
...
Hi all.

Is there some way to determine if the autofilter is on?

I have a button to display all data, but i want to exit the sub
if the data is not filtered.

Hope you understand what i'm trying to say.

Thanx in advance.





LD[_2_]

Autofilter
 
Sorry for not explaining it very well.
The autofilter is always on.
..EnableAutoFilter = True

I want to test if the data in the list is filtered or not.
Thanx again.


"LD" wrote in message
...
Hi all.

Is there some way to determine if the autofilter is on?

I have a button to display all data, but i want to exit the sub
if the data is not filtered.

Hope you understand what i'm trying to say.

Thanx in advance.





Rob van Gelder[_4_]

Autofilter
 
This previous posting by Colo may help:
http://groups.google.co.nz/groups?hl...rum-nospam.com

"LD" wrote in message
...
Sorry for not explaining it very well.
The autofilter is always on.
.EnableAutoFilter = True

I want to test if the data in the list is filtered or not.
Thanx again.


"LD" wrote in message
...
Hi all.

Is there some way to determine if the autofilter is on?

I have a button to display all data, but i want to exit the sub
if the data is not filtered.

Hope you understand what i'm trying to say.

Thanx in advance.







Leo Elbertse

Autofilter
 
If Not ActiveSheet.AutoFilterMode Then Exit Sub

Leo

On Fri, 2 Jan 2004 11:21:31 +0200, "LD" wrote:

Hi all.

Is there some way to determine if the autofilter is on?

I have a button to display all data, but i want to exit the sub
if the data is not filtered.

Hope you understand what i'm trying to say.

Thanx in advance.



Dave Peterson[_3_]

Autofilter
 
One way:

with activesheet
If .AutoFilterMode Then
If .FilterMode Then
.ShowAllData
End If
end if
end with

another way is to just ignore the error:

on error resume next
activesheet.showalldata
on error goto 0

=========

I'm not sure what you're using this for, but if it's a generic macro in your
personal.xls (say), you might find just adding a button to your favorite toolbar
is easier to run.

Tools|Customize|Commands Tab|Data Category
I've dragged both the "autofilter" and "show all" buttons to a customized
toolbar so that I can get to them more quickly than "data|filter|show all".






LD wrote:

Hi all.

Is there some way to determine if the autofilter is on?

I have a button to display all data, but i want to exit the sub
if the data is not filtered.

Hope you understand what i'm trying to say.

Thanx in advance.


--

Dave Peterson


Tom Ogilvy

Autofilter
 
if ActiveSheet.FilterMode then
msgbox "Data is filtered"
End if

From help on FilterMode

This property is True if the worksheet contains a filtered list in which
there are hidden rows.

--
Regards,
Tom Ogilvy

LD wrote in message
...
Sorry for not explaining it very well.
The autofilter is always on.
.EnableAutoFilter = True

I want to test if the data in the list is filtered or not.
Thanx again.


"LD" wrote in message
...
Hi all.

Is there some way to determine if the autofilter is on?

I have a button to display all data, but i want to exit the sub
if the data is not filtered.

Hope you understand what i'm trying to say.

Thanx in advance.








All times are GMT +1. The time now is 03:59 AM.

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