+ Reply to Thread
Results 1 to 5 of 5

Search for Multiple Criteria and Return all Rows that Match.

  1. #1
    Forum Contributor
    Join Date
    02-20-2011
    Location
    Candada
    MS-Off Ver
    Microsoft Office 365
    Posts
    174

    Smile Search for Multiple Criteria and Return all Rows that Match.

    I have a file where I can enter several criteria in B3 through B15 and then the macro will return all rows that match those particular criteria. However, I would like to know if there is a way to type several names in a single cell and search and return all rows corresponding to those names. For example, in B3 i would like to type Jane Smith, Brad Jones, John Doe and return all rows matching.
    Again, thank you very much for your time and help.
    Attached Files Attached Files

  2. #2
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Search for Multiple Criteria and Return all Rows that Match.

    Hi Kimston,
    try it
    Please Login or Register  to view this content.
    it will work in Excel 2007, 2010 (2013?)
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    02-20-2011
    Location
    Candada
    MS-Off Ver
    Microsoft Office 365
    Posts
    174

    Re: Search for Multiple Criteria and Return all Rows that Match.

    Thank you Nilem for your quick response. I am having some problems running this macro in MS 2003. It says "Compile error: Variable not defined". and it highlights
    Please Login or Register  to view this content.
    .
    I wonder if it has to do with the MS 2003 version.

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Search for Multiple Criteria and Return all Rows that Match.

    Kim,

    You can search Multiple criteria by using an array or a split funtion
    For e.g if you have the words you wish to search are in Range D3, separated by a comma, you can use this function

    words to search = Split(Range("D3"), "'")

  5. #5
    Forum Contributor
    Join Date
    02-20-2011
    Location
    Candada
    MS-Off Ver
    Microsoft Office 365
    Posts
    174

    Re: Search for Multiple Criteria and Return all Rows that Match.

    AB33,
    Thank you very much for your response. However, I don't quite understand how split function works, and I tried to used your function =Split(Range("D3"), ""), but it doesn't doe anything. Can ypu provide an example using the provided excel file?
    Thank you

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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