+ Reply to Thread
Results 1 to 6 of 6

Problem to to find match within multiple lines within Cell

  1. #1
    Registered User
    Join Date
    10-23-2013
    Location
    orchid,singapore
    MS-Off Ver
    Excel 2007
    Posts
    3

    Problem to to find match within multiple lines within Cell

    Hi Forumers,

    I have this little problem to get my head around fixing the issue to find match an entry in one column and search for the duplicate entry in another column in a different sheet.

    Result that Im trying to achieve here is to copy the whole row of a match entry in Sheet2. If it is comparing a single entry(sheet1) with another cell(sheet2) also with single entry, no issue found and I managed to copy the row to a new sheet(sheet3). But I the compare the cell that have multiple lines within a cell, no output will be copied to new sheet(sheet3) even though the cell contain match entry.

    Below are the macro I used for this purpose:



    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by stockish; 10-18-2015 at 04:08 AM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Problem to to find match within multiple lines within Cell

    Hello stockish,

    You will generally get better and more reliable results using Copy and PasteSpecial across worksheets. This also allows you more choices in what you wish to paste.

    Her is the macro with this option added...
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    10-23-2013
    Location
    orchid,singapore
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Problem to to find match within multiple lines within Cell

    Hi Leith,

    Apology for the incorrect format when posting the codes in this forum, will ensure to follow rules in the future before posting.

    Thank you very much for assistance in improving my macro to achieve better result, much appreciated but I still cant get the intended output based on my macro. Really appreciate if you or anyone can shed some lights to resolve my issue.

    For example :

    Sheet1A5 contain value of '5' but it failed to find the match in Sheet2 even though Sheet2B2 has that value.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Problem to to find match within multiple lines within Cell

    Hello stockish,

    You are comparing the values as identical. If you don't have an identical match where sheet1's cell contents exactly match sheet2's cell contents, nothing will be copied.

    You need to do a partial match of the cell's contents. If it is true then copy the cell. I would like to help you further but it is 2:40 AM my time and I can barely read the screen. Hopefully, someone else will help you with the coding.

  5. #5
    Registered User
    Join Date
    10-23-2013
    Location
    orchid,singapore
    MS-Off Ver
    Excel 2007
    Posts
    3
    Quote Originally Posted by Leith Ross View Post
    Hello stockish,

    You are comparing the values as identical. If you don't have an identical match where sheet1's cell contents exactly match sheet2's cell contents, nothing will be copied.

    You need to do a partial match of the cell's contents. If it is true then copy the cell. I would like to help you further but it is 2:40 AM my time and I can barely read the screen. Hopefully, someone else will help you with the coding.
    I totally get your point to do a partially match of the cell contents but to do a macro based on that is something that I am not able to translate in vba language due my level knowledge in vba. Trying to improve my vba skill from time to time though but this time around i really hit a wall..

    Thank you anyway Leith for your help..get some good rest
    Last edited by stockish; 10-18-2015 at 05:58 AM.

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Problem to to find match within multiple lines within Cell

    Hello stockish,

    Looks like nobody stepped in to help. I modified the macro to perform a case insensitive partial match using the InStr method. The macro now produces eleven matches.

    Please Login or Register  to view this content.

+ 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. [SOLVED] multiple cell value to find match in range
    By utmw2016 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-10-2015, 11:13 PM
  2. Find/Replace one line with multiple lines
    By ugonow in forum Excel General
    Replies: 4
    Last Post: 03-13-2013, 11:59 PM
  3. [SOLVED] Problem with Find function. Need to find Exact match
    By SMILE in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-06-2012, 07:07 AM
  4. Find a match from a cell that has multiple values?
    By rjos4 in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 02-18-2011, 05:47 PM
  5. Find exact match in cell with multiple strings
    By Garage23 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-16-2010, 07:23 AM
  6. Replies: 1
    Last Post: 12-17-2009, 03:46 AM
  7. Replies: 1
    Last Post: 02-08-2005, 03:06 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