+ Reply to Thread
Results 1 to 13 of 13

How to create drop down list that return a result when a selected.

  1. #1
    Registered User
    Join Date
    10-28-2013
    Location
    Davao
    MS-Off Ver
    Excel 2003
    Posts
    14

    Smile How to create drop down list that return a result when a selected.

    I have data's that I will be using as my list using a drop down list, on the drop down list when I selected one of the data in the drop down list it will give a certain result, example: The drop down list show like this.

    1777 = Samsung
    1778 = Nokia
    1779 = Apple
    1780 = Sony
    1781 = Alcatel
    1782 = Blackberry

    When I selected 1777 it will give me a corresponding result of Samsung. would it possible that way?

  2. #2
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: How to create drop down list that return a result when a selected.

    Here!

    Are you looking for something of this sort (File Attached)?

    If you want it to change automatically, you can put the code in Worksheet_Change, with some minor changes.

    Hope it helps.

    Deep
    Attached Files Attached Files
    Cheers!
    Deep Dave

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: How to create drop down list that return a result when a selected.

    Hi and welcome to the forum

    You dont need a macro for this, a simple VLOOKUP will give you what you want. Just create a small 2-column table (see below), and assuming your DV is in d1, =vlookup(D1,$A$1:$B$6,2,0)

    A
    B
    1
    1777
    Samsung
    2
    1778
    Nokia
    3
    1779
    Apple
    4
    1780
    Sony
    5
    1781
    Alcatel
    6
    1782
    Blackberry
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    10-28-2013
    Location
    Davao
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: How to create drop down list that return a result when a selected.

    yes, it works without macro, additional query, how about the source data list where from another sheet how to do it, Example the list is form sheet1 then dropdown list is shown in sheet2, in short the data coming from sheet1 the result shown in sheet2

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: How to create drop down list that return a result when a selected.

    No problem, just include the sheet name in the formula,...
    if the formula will be on sheet2, then this...
    =vlookup(D1,sheet1!$A$1:$B$6,2,0)

    If the formula will be in sheet1, then this...
    =vlookup(sheet2!D1,$A$1:$B$6,2,0)

    The easiest way to construct it, is to just point to the range/s when making the formula, excel will add the sheet names for you. Just remember to absolute the search range...$A$1:$B$6

  6. #6
    Registered User
    Join Date
    10-28-2013
    Location
    Davao
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: How to create drop down list that return a result when a selected.

    yes, it works without macro, additional query, how about the source data list where from another sheet how to do it, Example the list is form sheet1 then dropdown list is shown in sheet2, in short the data coming from sheet1 the result shown in sheet2.

  7. #7
    Registered User
    Join Date
    10-28-2013
    Location
    Davao
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: How to create drop down list that return a result when a selected.

    I tried using data validation to create a new drop down list with data in 1st sheet as my source data, but data validation won't allow to me to use data coming from 1st sheet, this is in reference to your 1st solution given, the only difference is the source is coming from 1st sheet not on the sheet where i input data at the same time creating a drop down list.

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: How to create drop down list that return a result when a selected.

    No Dv wont let you reference a range on another sheet. But if you give that range a name, and then reference the name, it will work

    So instead of "sheet1!$A$1:$B$6" if you give that range a name (say dandy), then you would use =vlookup(D1,dandy,2,0)

  9. #9
    Registered User
    Join Date
    10-28-2013
    Location
    Davao
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: How to create drop down list that return a result when a selected.

    on the attached data can you have it input the correct syntax using the same process with,
    drop down list with result coming from vlookup but on separate sheet.
    Attached Files Attached Files

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: How to create drop down list that return a result when a selected.

    Sure, and I will walk you through what im doing...
    1. highlight the range on Data A3:A8
    2. right-click into the range and select Name a Range
    3. give it any name you want, I used "Number" (without the "") Remember what name you used, because when we use it in step 5, it MUST be identical
    4. Select RESULTS sheet and click on A2
    5. select DATA tab, click Data Validation, under ALLOW, select LIST, and next to SOURCE enter =number. Click OK

    You should now see a drop-down in that cell, click it and you should see all the numbers from DATA

    Then in B2, copy this...
    =VLOOKUP(A2,Data!$A$3:$B$8,2,0)

  11. #11
    Registered User
    Join Date
    10-28-2013
    Location
    Davao
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: How to create drop down list that return a result when a selected.

    Cheers, It works, Thanks a lot,. Sir my gratitude.

  12. #12
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: How to create drop down list that return a result when a selected.

    you'r welcome. If this answered your question, please take a moment to mark the thread as "solved" - it helps keep things neat and tidy lol, and consider adding the reputation to those that helped (see points 2 & 3 below my 1st post to you)

  13. #13
    Registered User
    Join Date
    10-28-2013
    Location
    Davao
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: How to create drop down list that return a result when a selected.

    Noted Sir, where do i click solved in this thread, just a newbie here?

+ 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. [SOLVED] Create a Drop-Down List of Delmited Text within a selected Cell
    By lesoies in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-03-2013, 05:51 PM
  2. how to create a drop down list that will populate multiple cells after selected
    By aaronriggle in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-07-2012, 06:59 PM
  3. Replies: 1
    Last Post: 07-13-2012, 12:11 PM
  4. Replies: 7
    Last Post: 02-27-2008, 03:53 PM
  5. Replies: 1
    Last Post: 04-11-2005, 01:06 PM

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