+ Reply to Thread
Results 1 to 5 of 5

VBA Array w/multiple search criteria

  1. #1
    Registered User
    Join Date
    02-24-2013
    Location
    Washington
    MS-Off Ver
    Excel 2010
    Posts
    16

    VBA Array w/multiple search criteria

    So I've spent a few days trying to sort this out, but am not having much luck. On the surface this seems to be an easy enough premise. I have table of data. I need the table to hide certain rows depending on what the user punches into the search box. If they search for "Sam", any row not including "Sam" is hidden. However, best case scenario would be that the user could punch in more than one variable, and it would filter even further - "Sam 2011" etc. I've found vba scripts that come close to what I'm trying to achieve... but nothing close enough to superficially edit. Any help/direction would be greatly appreciated!Sample.xls

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: VBA Array w/multiple search criteria

    This might get you in the right direction. See attatched
    Attached Files Attached Files
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  3. #3
    Registered User
    Join Date
    02-24-2013
    Location
    Washington
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: VBA Array w/multiple search criteria

    That is almost perfect. The only downside is that it can only filter by one of those three variables at one time. I found a similar way to accomplish that working earlier, but destroyed it unintentionally while trying to alter it. Is it a limit of excel, or is there a way to modify the code to accommodate multiple variables simultaneously?

  4. #4
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: VBA Array w/multiple search criteria

    hi Jeepster325, please check attachment, insert value in B5, conditions should be delimited with space
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    02-24-2013
    Location
    Washington
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: VBA Array w/multiple search criteria

    That did it! Thank you both for the assistance.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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