+ Reply to Thread
Results 1 to 10 of 10

Help with Data valadation List

  1. #1
    Registered User
    Join Date
    04-14-2011
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Help with Data valadation List

    I am not sure how to ask this question but here goes. I am trying to create a form where when I select an item for a drop down box (data validation List) It automatically selects the appropriate data and places it into the next column. For example, if I select payroll in the list it automatically puts 073-119-043, but If i select travel it puts 073-306-871 in the next column.
    Last edited by StubbornOx; 04-14-2011 at 01:30 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Help with Data valadation List

    You would need to create a table of values somewhere on the side which stores the selectable items and the corresponding codes. Then use VLOOKUP

    e.g.

    =Vlookup(A1,'Sheet2'!A:B,2,FALSE)

    This looks up item in your dropdown list in A1 and finds it in Sheet2, column A, and returns corresponding item from column B.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Help with Data valadation List

    Hi StubbornOx and welcome to the forum.

    There are always a few methods that work. NBVC suggested one but I was thinking a Multi Column ComboBox may also work, depending on what you finally need.

    Read http://www.contextures.com/Excel-VBA...Box-Lists.html
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Help with Data valadation List

    You would want to put a vlookup in the next column and set up a table, let's say on sheet2 A2:C50. So if your data validation is in A1 of sheet1, in A2 you'd have something like

    =IF(A1<>"", VLOOKUP(A1, Sheet2!$A$2:$C$50,2,FALSE),"")
    If you name the table on sheet2, i.e. "Codes" this formula becomes
    =IF(A1<>"", VLOOKUP(A1, Codes, 2, False), "")
    Any questions?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

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

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Help with Data valadation List

    Why didn't you use code tags?
    Is that a question?

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Help with Data valadation List

    Quote Originally Posted by MarvinP
    Why didn't you use code tags?
    Answer found here.

    http://www.excelforum.com/the-water-...code-tags.html
    I'm still on the fence. Perhaps I shall on odd #'d posts.

  7. #7
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Help with Data valadation List

    I got scolded a few days back for not putting code tags on a very short and inline phrase.

    I guess it's Moderator Preference and how they are feeling today.

    Thanks for showing your independence. I think we all have brains but some of us have special preferences.

    HEY - you could do a little random number generator that would replace Code tags with Quote Tags depending on....

  8. #8
    Registered User
    Join Date
    04-14-2011
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Help with Data valadation List

    Thanks NVBC that worked.

  9. #9
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Help with Data valadation List

    Thanks NVBC that worked.
    Sureeeeee, just because he's faster than us and better at excel and gets his post in first.
    Chemistb <-- chopped liver


  10. #10
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Help with Data valadation List

    That new symbol of
    "<--" Chopped Liver
    Is that read "Less than chopped liver" or "Less than negativie chopped liver"?

+ 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