+ Reply to Thread
Results 1 to 2 of 2

inserting data from one worksheet to another

  1. #1
    Registered User
    Join Date
    09-06-2011
    Location
    Centurion, South Africa
    MS-Off Ver
    Excel 2007
    Posts
    1

    Wink inserting data from one worksheet to another

    Hi there, i hope someone can help me?
    How do I insert data from another worksheet, based on criteria in the current one?
    for instance- worksheet A has 2 columns: "name" and "code" Each name in the "name" column is unique, and has its own code:
    Ann, 001
    Ben, 002
    Claire, 003
    In worksheet B I have only the names, but many duplicates. how do i insert, in a seperate column, the code of the name of worksheet A?
    so, if the names in worksheet B look like this:
    Ann
    Ann
    Ben
    Claire
    Ann
    The code that is inserted into the row next to the names must be the same code that the names have in worksheet A. Each "Ann" should have the code 001 next to it- for instance.
    Many thanks!

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: inserting data from one worksheet to another

    Open both workbooks.

    On workbook B in cell B2, to get the code matching A2 from the other sheet, put in this formula:

    =VLOOKUP(A4,'[Workbook A.xls]Sheet1'!$A:$B, 2, 0)

    Once the correct value appears in B2, copy that cell downward through the whole data set.

    Close Workbook A.

    The formulas in Workbook B just expanded themselves to include the full path to Workbook A, so it will keep working even with the workbook closed.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ 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