+ Reply to Thread
Results 1 to 3 of 3

VBA Search a set of strings, return specific data if found

  1. #1
    Forum Contributor banaanas's Avatar
    Join Date
    08-26-2014
    Location
    Finland
    MS-Off Ver
    2016
    Posts
    199

    VBA Search a set of strings, return specific data if found

    Hi!

    I have a workbook with 2 sheets.

    Sheet 1 has written text in column A. Now i want to find if the text has a set of keywords that i have colected in sheet2.

    If the macro finds a match, will it paste a code from sheet2 column B to sheet1 column B.

    I got it almost to work with this:

    Please Login or Register  to view this content.
    The problem is that the macro only finds and pastes the first match in sheet1.

    What i really want is to search a set range (A1-A100) in sheet1 and repleace ALL instances, not only the first one.

    Here is the example:

    Book1.xlsm

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

    Re: VBA Search a set of strings, return specific data if found

    Hi
    try removing this line from your code
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor banaanas's Avatar
    Join Date
    08-26-2014
    Location
    Finland
    MS-Off Ver
    2016
    Posts
    199

    Re: VBA Search a set of strings, return specific data if found

    Oh my, thanks a bunch, that worked.

    One more question, how can i define the A columns search range in sheet1?

    I would like the macro only to look for values in A10-A200.

+ 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. excel formula to search Multiple strings in several columns and return strings
    By krratna123 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-13-2013, 11:20 AM
  2. Replies: 1
    Last Post: 08-13-2013, 08:32 AM
  3. Replies: 9
    Last Post: 09-13-2012, 03:44 PM
  4. Replies: 0
    Last Post: 01-14-2012, 02:13 AM
  5. find name; search column; if date found-return 3 data pts; move to next row
    By cdl in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-28-2008, 10:43 AM

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