+ Reply to Thread
Results 1 to 10 of 10

Lookup and Copy Cells with more than 255-characters

  1. #1
    Forum Contributor
    Join Date
    06-13-2009
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    245

    Smile Lookup and Copy Cells with more than 255-characters

    Hello, could someone please help me with the following Excel 2003 VBA problem:

    In the attached workbook named: Part Number and Comments Lookup.xls --- there are 2 x worksheets named:

    • Master_List
    • SupplierComments

    I need to look-up the Part Numbers in the Master_List worksheet to see if there is any corresponding Part Numbers in the SupplierComments worksheet.

    If so, I need the corresponding Comments in column K (SupplierComments worksheet) to be copied over to the Master_List worksheet in column Q.

    For example: Part Number 101 (located in cell C3 of the Master_List worksheet) has a corresponding part number in cell C3 of the SupplierComments worksheet.

    The comments in cell K3 (SupplierComments worksheet) need to be copied across to cell Q3 (Master_List worksheet).

    The main difficulty is that some of the cells in column K (SupplierComments worksheet) exceed 255 characters.

    I was trying a VLOOKUP in cell Q2 (Master_List worksheet) with the following formula and dragging it down column Q, however the cells that contain over 255 characters were truncated:

    =VLOOKUP(C2,SupplierComments!$C$2:$K$65,10,False)

    If someone could please help me with some VBA code to do this --- it would be greatly appreciated.

    Kind regards,

    Chris
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Lookup and Copy Cells with more than 255-characters

    Isn't it 9?
    =VLOOKUP(C2,SupplierComments!$C$2:$K$65,9,False)

    working here.

  3. #3
    Forum Contributor
    Join Date
    06-13-2009
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    245

    Re: Lookup and Copy Cells with more than 255-characters

    Hi jindon, my bad --- it is 9 --- sorry about that.

    Cheers,

    Chris

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Lookup and Copy Cells with more than 255-characters

    That formula is working properly with 2013.

    If you still have problem, how about Index/Match?
    =INDEX(SupplierComments!$C$2:$K$65,MATCH(C2,SupplierComments!$C$2:$C$65,0),9)

  5. #5
    Forum Contributor
    Join Date
    06-13-2009
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    245

    Re: Lookup and Copy Cells with more than 255-characters

    Hi jindon, thank you for your reply - much appreciated. Unfortunately, the INDEX MATCH formula works does not work properly in Excel 2003 as it truncates cells with more than 255 characters.

    As you advised previously, it does work with Excel 2010 and 2013.

    Unfortunately, I need this to work in Excel 2003 because that is the version we use at work.

    Cheers,

    Chris

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Lookup and Copy Cells with more than 255-characters

    Can you break the data in the column (K?) into 2 parts, then bring each part in om it's own?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Lookup and Copy Cells with more than 255-characters

    Then vba...
    It updates each time you select "Master_List" sheet.
    To Thisworkbook code module
    Please Login or Register  to view this content.
    To "Master_List" sheet code module
    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    06-13-2009
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    245

    Re: Lookup and Copy Cells with more than 255-characters

    Hi FDibbons, thank you for your reply - much appreciated.

    I possibly could break the data in column K into 2 parts and then concatenate each of the 2 parts together in column Q of the Master_List worksheet.

    I simply do not how to do this whilst performing a lookup?

    Regards,

    Chris

  9. #9
    Forum Contributor
    Join Date
    06-13-2009
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    245

    Re: Lookup and Copy Cells with more than 255-characters

    Hi jindon, thank you so much for your hard work and efforts in providing me with the VBA code - it works well - very grateful

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Lookup and Copy Cells with more than 255-characters

    I simply do not how to do this whilst performing a lookup?
    You would still do the lookup on the full cell, but just bring back the 2 components.

    But it seems that Jonmo's code works for you

+ 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] Lookup, when found copy certain cells
    By dutchmaste in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-04-2016, 08:11 AM
  2. Replies: 0
    Last Post: 05-27-2015, 10:23 AM
  3. Lookup and highlight text in cells with wildcard characters
    By Halulu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-29-2014, 10:06 AM
  4. Replies: 1
    Last Post: 07-02-2013, 10:55 AM
  5. Replies: 11
    Last Post: 01-23-2013, 02:04 PM
  6. Lookup and copy multiple cells into one
    By hg34 in forum Excel General
    Replies: 4
    Last Post: 06-17-2010, 07:12 PM
  7. Lookup Value & Then Copy 5 Cells To The Right
    By NSTurk725 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-26-2010, 06:19 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