Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2004
    Location
    London
    Posts
    10

    Unanswered: 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"?????

  2. #2
    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

  3. #3
    Join Date
    Nov 2004
    Location
    London
    Posts
    10
    Thank you very much this worked fine.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •