+ Reply to Thread
Results 1 to 3 of 3

Copy data from worksheet 2 to worksheet 1 if match found

  1. #1
    Registered User
    Join Date
    05-20-2011
    Location
    New York
    MS-Off Ver
    Excel 2003
    Posts
    5

    Copy data from worksheet 2 to worksheet 1 if match found

    Objective: Use a common key value (barcode) to combine data from 2 different lists

    Logic
    Compare value of each row in col A of Sheet 1 to all rows in Col A of Sheet 2
    If a match is found, move the values from Sheet 2 Col B to Col C to Sheet 1 Col B and Col
    If no match is found, leave blank


    Example
    Sheet 1 A2 = 1
    A search of Sheet 2 Col A finds a value of "1" in A11
    Therefore, move values from Sheet 2 B11 and C11 to Sheet 1 B2 and C2
    Moving (versus copying) will allow me to see which barcodes did not have a match


    Check value of each row in Col D against values in all rows of Col A If a match is found, copy the value in Col B to Col E and the value in Col C to Col f If no match is found, leave blank

    Sample spreadsheet attached.

    Thanks in advance for your help!
    Attached Files Attached Files
    Last edited by TSSRob; 11-18-2011 at 07:55 PM.

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Copy data from worksheet 2 to worksheet 1 if match found

    TSSRob,

    If you hadn't specifically said you wanted to move (cut) the data vs just copy it, I would argue that the data could be pulled using a VLookup() formula. Since you do want to move the data from sheet2 to sheet1, you should be able to use the following macro:
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    05-20-2011
    Location
    New York
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Copy data from worksheet 2 to worksheet 1 if match found

    Problem solved! Thank you so much.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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