+ Reply to Thread
Results 1 to 2 of 2

Search for multiple words and copy/paste rows

  1. #1
    Registered User
    Join Date
    08-19-2010
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    8

    Question Search for multiple words and copy/paste rows

    Hello,

    I have a large excel database with over 20,000 rows as in the attached example and would like a VBA macro script which pops up a search form like the binoculars tab to search a between 1 to 10 words (text or values) within the database on sheet 1. Whenever any word is found, the whole row is copied onto sheet 2. I require the search to be effected on the entire sheet 1, and not within a single column. I would also need the search not to be an exact 'match' i.e. i'd like it to pick words within words - e.g. if I search for 'car' in the form and there exists a word named 'cards' on the database (sheet 1), then i'd like it to copy the 'cards' row onto sheet 2 as well. On the attached file I have shown an example of how the search for the words: Car, Toner, Cartridge and Ink would result on sheet 2.

    I thank you for your support and assistance
    Attached Files Attached Files

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Search for multiple words and copy&paste rows to new sheet

    This macro will prompt you for the strings you want to find. After you've finished entering strings, it will copy all the rows that matched any of the strings to Sheet2.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ 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