+ Reply to Thread
Results 1 to 5 of 5

Using Filter() for WildCards

  1. #1
    Forum Contributor Rhudi's Avatar
    Join Date
    03-08-2013
    Location
    South Carolina, US
    MS-Off Ver
    Professional Plus 2016 aka Office 365
    Posts
    201

    Using Filter() for WildCards

    I'm sure this has been answered, but I'm not sure how to ask. All the searches I've tried keep giving me "Auto Filter" type answers that are no help.

    Here goes... This is what I am trying to do...

    I'm using this in some code:
    Please Login or Register  to view this content.
    I thought I could do this:
    Please Login or Register  to view this content.
    ... and the answer is "Nope. Doesn't work like that."

    What I'm trying to do is a partial-match search where the data might be "'... unit 505# '" (there is a space in there, so I won't hit '... unit 505 ', but need to find '... unit 5050 ' to '... unit 5059 ').

    I bet this is so simple. :P

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Using Filter() for WildCards

    The filter function is designed for arrays. Have you considered the Instr function as an alternative for a single string variable?

  3. #3
    Forum Contributor Rhudi's Avatar
    Join Date
    03-08-2013
    Location
    South Carolina, US
    MS-Off Ver
    Professional Plus 2016 aka Office 365
    Posts
    201

    Re: Using Filter() for WildCards

    UIPAddress is an array.
    Initially, it will have all the interfaces lines from a Juniper router dump.
    What I'm doing with the filter is just being left with only the lines that match my text. I've been doing exact matching just fine this way.

    Now, I want to be able to partial-match.

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,009

    Re: Using Filter() for WildCards

    Filter returns an array of the strings that contain the substring you specified. You don't need wildcards. For example:
    Please Login or Register  to view this content.
    Everyone who confuses correlation and causation ends up dead.

  5. #5
    Forum Contributor Rhudi's Avatar
    Join Date
    03-08-2013
    Location
    South Carolina, US
    MS-Off Ver
    Professional Plus 2016 aka Office 365
    Posts
    201

    Re: Using Filter() for WildCards

    That doesn't work for my situation.
    If I have an array that contains:
    ...
    "505 "
    "...
    "5050 "
    "5051 "
    "5059 "
    ...

    If I'm looking for all the 505x (but not the 505), I'd want to search for "505? ".

    I suppose that I could filter, then length match and drop the items that aren't the correct length.

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,009

    Re: Using Filter() for WildCards

    It's either that or loop through all the items.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Need to filter a report filter based on the previous filter
    By elliotencore in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 01-28-2014, 07:44 AM
  2. Filter multiple criteria using wildcards
    By Opy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-18-2012, 11:40 PM
  3. Replies: 0
    Last Post: 10-11-2011, 09:06 AM
  4. Wildcards...
    By swingline54797 in forum Excel General
    Replies: 2
    Last Post: 07-15-2008, 02:31 PM
  5. [SOLVED] Wildcards in Advanced filter criteria don't work with Excel 2003
    By Inconceivable in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-14-2005, 10:05 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1