+ Reply to Thread
Results 1 to 4 of 4

Find Words from an entire column in a cell

  1. #1
    Registered User
    Join Date
    07-24-2013
    Location
    toronto
    MS-Off Ver
    Excel 2003
    Posts
    9

    Find Words from an entire column in a cell

    Hi,

    I like to write a macro that finds words from an entire column in a cell and then returns a value associated with that founded word.

    Here is an example:

    My reference file (Sheet1 ):
    column A (A2 to A5): Apple , Orange, grape, Strawberry
    Column B (B2 to B5): 123, 456, 789, 001

    My worksheet (Sheet 2):
    Column A is Description (A2 to A5): "I love Apple" , "Strawberry//a123", "Orange4H70, huil;sf"
    Column B is Code which is unknown.

    I like to look at the description, then search in Column A sheet 1 , find the word Apple , and then return the code for apple which is 123.

    If there are two words found in the description, i like to only consider the first one appear in the reference file.

    I would appreciate any help in writing this search loop.

    Thank you,
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Find Words from an entire column in a cell

    try
    Please Login or Register  to view this content.
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    07-24-2013
    Location
    toronto
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Find Words from an entire column in a cell

    Hey,

    the formula doesnt work for the last case :Orange4H70, huil;sfapple, it returns the code for grape. could you provide a loop formula that goes over all the keyword and match it with description in order to return the code value?

    Thank you,

  4. #4
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Find Words from an entire column in a cell

    Please Login or Register  to view this content.
    Loop formula

    instr is case sensitive

    if you dont care about case
    convert the two values into uppercase with UCASE formula

    Please Login or Register  to view this content.
    Last edited by humdingaling; 07-31-2013 at 11:44 PM.

+ 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. Replies: 3
    Last Post: 11-28-2012, 04:00 AM
  2. [SOLVED] Delete entire row if the cell has three 3 or two 2 letter words
    By plasma33 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-21-2012, 08:23 PM
  3. Replies: 4
    Last Post: 04-27-2012, 06:38 AM
  4. Find Average in entire column, ignore cell if it = 0
    By cooper1308 in forum Excel General
    Replies: 2
    Last Post: 10-26-2009, 07:33 AM
  5. Replies: 3
    Last Post: 06-06-2009, 12:18 PM

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