+ Reply to Thread
Results 1 to 6 of 6

Data mapping one sheet to another

  1. #1
    Registered User
    Join Date
    03-21-2009
    Location
    Bangalore
    MS-Off Ver
    Excel 2003
    Posts
    60

    Data mapping one sheet to another

    Hi Friends,

    I have a workbook containing 3 worksheet Countries, Country Code, Country Name respectively. The worksheet countrries contains list of country code and country names. The worksheet "country code" range H10 contains country code. If the range H10 contans country code as IN and it should display as India in cell of D5 in "country name" sheet. The values should from the "countries" worksheet.

    ex: if cell h10 in the "country code" sheet contains the value USA it should display as "United States of America" in the cell D5 in the "country name" sheet.


    Please find attached workbook for your reference and also find code below which I was wrote.

    Please Login or Register  to view this content.

    Please kindly provide me the solution.

    Thanks & Regards
    Ramesh
    Attached Files Attached Files

  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: Data mapping one sheet to another

    There's no need for a macro. Just put this formula in D5:

    =INDEX(countries!B:B, MATCH('Country Code'!H10, countries!A:A, 0))

    Or:

    =VLOOKUP('Country Code'!H10, countries!A:B, 2, FALSE)

    Or even:

    =LOOKUP('Country Code'!H10, countries!A:A, countries!B:B
    (works because your data is sorted in column A)
    _________________
    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!)

  3. #3
    Registered User
    Join Date
    03-21-2009
    Location
    Bangalore
    MS-Off Ver
    Excel 2003
    Posts
    60

    Re: Data mapping one sheet to another

    Hi,

    Thank you very much for replying my post.

    I need do this through macro only. Here my code follows.

    Please Login or Register  to view this content.
    This is the my code, I am getting error in this code please correct and reply for me

    Regards
    Ramesh

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

    Re: Data mapping one sheet to another

    Then the answer is still the same, just in VBA:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-21-2009
    Location
    Bangalore
    MS-Off Ver
    Excel 2003
    Posts
    60

    Re: Data mapping one sheet to another

    Hi JBeaucaire ,

    Thank you, It is working fine. I would be greateful, if you tell how to work with the same from different workbooks . Sorry for asking too many questions.


    Thanks & Regards
    Ramesh

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

    Re: Data mapping one sheet to another

    Have you ever created a formula that referred to a different workbook? It looks something like this:

    =[Store.xls]Sheet1!$A$1

    See the part in red shows how the workbook name is included in the formula. You need only add that to your formulas.

+ 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