+ Reply to Thread
Results 1 to 3 of 3

Trying to use a dropdown of one field to retrieve a value from another field

  1. #1
    Registered User
    Join Date
    05-09-2011
    Location
    McElhattan, Pennsylvania, USA
    MS-Off Ver
    Excel 2010
    Posts
    9

    Question Trying to use a dropdown of one field to retrieve a value from another field

    What I have is a very "rigid" formatted spreadsheet page, that is printed and submitted to the home office. What the end result that is wanted, is the person wants to select a text value from a drop down list and have it return its corresponding numeric value.

    The information is on a separate page of the spreadsheet with the first column being the numeric value and the second being the Text name of that value.

    EX:
    TabName: Name Codes
    Code Name
    1 Adams
    2 Jones
    3 Peter
    4 John

    On the main page, the person wants to select "Adams" from a drop down list but in the same field have it return a 1, instead of the word 'Adams'.

    Any help is appreciated.
    Thanks in advance,

    Tom Cusick

  2. #2
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Trying to use a dropdown of one field to retrieve a value from another field

    Hi Tom,
    Welcome to the forum.

    You can achieve this with the help of a VBA code.
    Right click on the Sheet Tab (Main Page) --> View Code --> And paste the following code into the opened code window --> Close the VBA editor --> Save your workbook as Macro-Enabled Workbook.

    In the attached, I have inserted a drop-down list in the range A2:A15 and so if you select a Name from the drop-down list, it's corresponding Code from Name Codes Sheet will be displayed in the cell.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  3. #3
    Registered User
    Join Date
    03-08-2013
    Location
    Oakland, CA
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Trying to use a dropdown of one field to retrieve a value from another field

    Hello sktneer/Tom - - I tried to follow the instructions but it didn't work for me. I am sure that it's me as I know nothing about VB. Note: I downloaded Sktneer's example, when I chose Adam from the dropdown, Adam was returned, not 1. ...and yes, I did enable editing.

    I have the same ask.
    - My Dropdown in Column I: Safety, Financial, Quality.
    - The data that I would like to return in Column J: 15, 30, 45 respectively

    How do I make this work with my spreadsheet. Thank You, so much, in advance.

+ 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. Replies: 9
    Last Post: 08-24-2015, 05:46 AM
  2. [SOLVED] PowerPivot: Merge Month Field and Year Field Into a Date Field
    By mo4391 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 07-17-2015, 11:59 AM
  3. Using Array in a row to retrieve specified field
    By kumatae in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-07-2013, 12:17 PM
  4. Show a dropdown when another field is populated
    By Lata in forum Excel General
    Replies: 11
    Last Post: 01-29-2013, 03:43 PM
  5. Replies: 0
    Last Post: 06-26-2012, 09:06 PM
  6. Replies: 3
    Last Post: 03-03-2012, 12:16 PM
  7. search field within dropdown
    By GreatLakesJK in forum Excel General
    Replies: 2
    Last Post: 10-06-2010, 03:33 PM

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