Results 1 to 3 of 3

Thread: Referencing Filter Criteria
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Nov 2003
    Posts
    28
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Referencing Filter Criteria

    I am trying to figure out how to reference individual column filter criteria in an IF/Then statement. I was able to use AutoFilter.Filters(CF).Criteria1 where CF is a variable for the column. Using this method, though, if column A has a criteria selected, then column B shows up as having a criteria too, because only certain rows are being selected, based on the criteria in column A. If I hold the cursor over the Filter Icon at the top of column A, it says, "Number:" and "Equals"3"" (the column name and the value that the column is being filtered by). If I hold the cursor over the Filter Icon at the top of column B, it says, "Color:" and "(Showing All)" (the column name and the fact that no criteria was selected). If anybody can provide me a way to reference the "(Showing All)" comment in my If/Then statement, I believe I can accomplish my goal.
    Last edited by prcrstntr; Sep 24th, 2019 at 05:50 PM.

  2. #2
    Board Regular
    Join Date
    Nov 2008
    Location
    Netherlands
    Posts
    3,471
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)

    Default Re: Referencing Filter Criteria

    Short Guide to Better VBA - Link: https://www.mrexcel.com/forum/showthread.php?t=712119

    Please use code tags around your code:
    [Code] Your code here... [/Code]




    Engelse lessen, persoonlijk en doelgericht. Dutch tuition tailor-made for you. https://Ennef.nl

    Wearable for people with panic attacks: sidjup https://sidjup.com

  3. #3
    New Member
    Join Date
    Nov 2003
    Posts
    28
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Referencing Filter Criteria

    Thanks for sharing the link, sijpie. I will look into it further for future reference. Last night I was able to solve my problem by using, "IF AutoFilter.Filters(CF).Criteria1 = Empty Then", where Empty represents the "(Showing All)" comment or nothing selected for the filter in that column, it gives me a reliable result.

    Not what I was specifically asking for, but it does meet my needs.

    I consider my issue solved, unless somebody has an interest in pursuing it.

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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