If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Identify the Criteria current in an AutoFilter

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-31-04, 08:05
MASARU MASARU is offline
Registered User
 
Join Date: Nov 2004
Location: London
Posts: 10
Identify the Criteria current in an AutoFilter

Happy New Year!

I was wondering if it is possible to identify is an autofilter as any filters applied and if so what filter is being applied.

I have a spreadsheets that has several filters. I need to check if any of the filters are being used and if so turn it off, do something with the spreadsheet, and then reset the filter to its original setting.

at the moment I just turn the filter of and on using
Selection.AutoFilter Field:=4
Selection.AutoFilter Field:=4, Criteria1:="help"
but what if the filter was on "please"?????
Reply With Quote
  #2 (permalink)  
Old 01-04-05, 16:13
cpod cpod is offline
Registered User
 
Join Date: Feb 2002
Posts: 29
To check whether there are any autofilters on a sheet:

test = ThisWorkbook.Worksheets("sheet1").AutoFilterMode

To check whether a particular autofilter is being used:

test = ThisWorkbook.Worksheets("sheet1").AutoFilter.Filte rs(1).On

To get the criteria for that filter:

test = ThisWorkbook.Worksheets("sheet1").AutoFilter.Filte rs(1).Criteria1
Reply With Quote
  #3 (permalink)  
Old 01-05-05, 09:03
MASARU MASARU is offline
Registered User
 
Join Date: Nov 2004
Location: London
Posts: 10
Thank you very much this worked fine.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On