#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default 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.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default 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.






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default 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.




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default 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

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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.






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:42 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"