+ Reply to Thread
Results 1 to 6 of 6

Setting up a search macro to find multiple words

  1. #1
    Registered User
    Join Date
    03-08-2012
    Location
    New Hampshire
    MS-Off Ver
    2010
    Posts
    12

    Setting up a search macro to find multiple words

    Hello, I need some addition help with a search macro.

    What I have
    I currently have a search macro set up the searches column A for what you have typed into H5, if it finds the value in H5 in column A it copies columns A to F and pastes that info into H12- M12 (first it will clear all contents in these cells to avoid showing the wrong results) The macro is written as follows:
    Please Login or Register  to view this content.

    What I need
    The macro only searches for single values for example if I type in lion I will get all results with lion involved but if I type in angry lion I will show no results even though in column A I have lion, cat, angry, fierce. Also if i type in Lion I will get nothing due to the upper case.
    1. Is there a way to search for both upper and lower case values?
    2. How can I search for multiple words at once that are not right next to each other?

    any help would be greatly appreciated, thanks.

    -Joe.
    Last edited by Leith Ross; 03-16-2012 at 06:13 PM. Reason: Added Code Tags

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

    Re: Setting up a search macro to find multiple words

    Try the following

    Please Login or Register  to view this content.
    I've assumed that words in the search term will be separated by a space.
    Martin

  3. #3
    Registered User
    Join Date
    03-08-2012
    Location
    New Hampshire
    MS-Off Ver
    2010
    Posts
    12

    Re: Setting up a search macro to find multiple words

    I had to modify this a bit but this was more what I was after, thanks for the reply here is the code I used:

    Please Login or Register  to view this content.
    Thanks again!

  4. #4
    Registered User
    Join Date
    03-08-2012
    Location
    New Hampshire
    MS-Off Ver
    2010
    Posts
    12

    Re: Setting up a search macro to find multiple words

    only thing I forgot was to set something for Both uppercase and lower case, working on it now.

  5. #5
    Registered User
    Join Date
    03-08-2012
    Location
    New Hampshire
    MS-Off Ver
    2010
    Posts
    12

    Re: Setting up a search macro to find multiple words

    added

    If InStr(1, Cell, MyArray(N), vbTextCompare) <> 0 Then

    fixed everything

  6. #6
    Registered User
    Join Date
    09-19-2013
    Location
    Makati, Philippines
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Setting up a search macro to find multiple words

    hi why this macro not working in my sheet.. im using excel 2010

+ 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