+ Reply to Thread
Results 1 to 6 of 6

Search Col.A for words that contain charactrs in Col.B & list all matches adjacently

  1. #1
    Registered User
    Join Date
    11-04-2010
    Location
    Man, England
    MS-Off Ver
    Excel 2003
    Posts
    3

    Search Col.A for words that contain charactrs in Col.B & list all matches adjacently

    Hey All, Is there anyone who can help me with the query below?

    I have a column that list a series of Mandarin (Chinese) words (Column A), adajacent to that column I have a list of individual characters (Column B). I want to search Column A for all words that contain characters in Column B and return all matching words (comma seperated) in Column C adjacent to each character,

    Example below (or see attachment):

    WordsCharacter Result
    后天 后天,后边, 以后
    后边 明天,明年,明堂
    明天
    明年
    以后
    明堂

    Any code/formulae that would help would be much appreciated.
    Attached Files Attached Files
    Last edited by macemegane; 11-13-2010 at 11:02 AM.

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Search Col.A for words that contain charactrs in Col.B & list all matches adjacen

    Depends on how much you have to do.

    If it is only a few words then this might give you a start.
    Attached Files Attached Files
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  3. #3
    Registered User
    Join Date
    11-04-2010
    Location
    Man, England
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Search Col.A for words that contain charactrs in Col.B & list all matches adjacen

    Hi Marcol,

    This has definately got me started, thanks a lot for your help! Works really well when dealing with a few dozen characters. I transposed the characters horizontally, extended the formula for all the characters, copied the last row and created a table with characters running vertically and matching words pasted adjacently to them on the right. (see next version of spreadsheet)

    Is there a macro based approach that would do get us to the same end result?


    Ideally with a flexible column range for Column A and B, as words/characters can range from a a few hundred to a few thousand.

    As a note, Column A will always contain the words, Column B the characters with Column C being the preferred destination for the end result i.e. of all matching words from Col. A that relate to the the respective adjacent character.

    Any further help would be much appreciated!
    Attached Files Attached Files

  4. #4
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Search Col.A for words that contain charactrs in Col.B & list all matches adjacen

    Try this
    Please Login or Register  to view this content.

    It's a bit akward debugging chinese characters in VBa, your characters will show as "?" and in this case words will be "??" and the result e.g. "?? , ?? , ??", but it all seems to work.

    Run the macro on sheet "Formula Solution - Marcol" to test

    Hope this helps

    [EDIT]
    This should be fine for a few thousand lines, but if your data runs to tens of thousand rows, then a find/find next loop will be faster executing.
    Attached Files Attached Files
    Last edited by Marcol; 11-12-2010 at 05:52 AM.

  5. #5
    Registered User
    Join Date
    11-04-2010
    Location
    Man, England
    MS-Off Ver
    Excel 2003
    Posts
    3

    Thumbs up Re: Search Col.A for words that contain charactrs in Col.B & list all matches adjacen

    Hi Marcol,

    The code works really well. Thanks so much for all your help! Gratefully recieved!!

  6. #6
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Search Col.A for words that contain charactrs in Col.B & list all matches adjacen

    Happy to help

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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