Consulting

Results 1 to 6 of 6

Thread: Using Autofilter Custom feature...

  1. #1
    VBAX Regular
    Joined
    Aug 2007
    Posts
    27
    Location

    Using Autofilter Custom feature...

    Hi again Experts (so I hear others say).

    I have come across a situation while using the Excel Autofilter Custom in Excel 2002 where you select these range of options to choose from.

    When I use the "contains" selection and specify 1
    I will get a list of entries that contains anything with a "1" in it. That is no problem.

    Is it possible to do this with a range of numbers like 0-9 ?

    In other words instead of repeating these steps for each number can we do this similar to the VBA like [0-9] thing?

    It does really matter if we can't do this but I am curious would it work?

    Thanks and warm regards,
    Psionic
    Nothing is your fault. Everything is your responsibility. -- Louix Dor Dempriey.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    You could easily add a helper column that checked for such and filter by that column. Not direct, but easy.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    I'm thinking of an answer, can you tell what it is ?
    2+2=9 ... (My Arithmetic Is Mental)

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Perhaps others will tell him.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    Unfortunately, as Bob mentioned, you only have two criteria to use per column with AutoFilter. If you had an additional column you could use (assuming your data was in col A), in B2 you could enter the following to find any number within a value...

    [vba]=IF(COUNT(VALUE(MID(A2,ROW($A$1:OFFSET($A$1,LEN(A2)-1,0)),1)))>0,1,0)[/vba]

    Edit: This is an array formula, must be confirmed with Ctrl + Shift + Enter instead of just Enter.

    Add a header to B1 and filter for a 1 value.

    HTH

  6. #6
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    You can do it without an array formula

    =ISNUMBER(--MID(A1,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&"0123456789")),1))
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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