Excel macro: merge data

Posted on 2011-05-12
Last Modified: 2012-05-11
Hi Experts,

Data from 2 sheets need to be merged.
Values from sheet1 column E need looked up in sheet2 column A.
If found the corresponding value of sheet2 column B needs copied to sheet1 column D.


The  xls file with sample data is attached.

Thanks a lot!

Question by:Watnog
    LVL 24

    Assisted Solution

    Try this in D2 and copied down:

    LVL 4

    Accepted Solution


    use VLOOKUP function. For the first row in the example table it is:

    Attached is the example XLS file with solution.
    LVL 24

    Expert Comment

    Or if you wanted to have a blank rather than error message:


    Author Comment

    Thank you both.
    The vlookup does a great job.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Suggested Solutions

    Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
    Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
    This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
    This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now