+ Reply to Thread
Results 1 to 6 of 6

From one drop down to another

Hybrid View

  1. #1
    Registered User
    Join Date
    10-06-2006
    Posts
    6

    From one drop down to another

    I have a sheet with 3 drop down boxes on it. I want to be able to select a choice in drop down 1 and then have drop down 2 populated with choices based off of what the user selects in drop down 1, then after the user makes a choice in drop down 2, a number between 15 and 30 in drop down 3 is selected and a cell is populated with info based off of all three drop downs. Sound confusing? Here is an example...We will say drop down 1 has the choices of blank, HNL, OGG and ITO. If the user picks HNL then drop down 2 gives the choices 4L, 4R, 8L. If OGG is picked then drop down 2 lists 5, 23. So we decide to pick HNL, 4L and then 15. When this is done I want the combination of all three choices to wind up choosing a paticular value that I will have stored in a table of cells. So maybe HNL, 4L and 15 = 522 and HNL, 4L and 16 = 519 etc.

    So far I have drop down 1 working with my choices and then it outputs to cell E10. I'm thinking if I can get drop down 2 to read E10 and then based off of whether it says 1, 2, 3 or 4 it chooses a different input range of say nothing (blank), G3:J3, G4:H4 or G5:H5 to use as its choices. Any idea's?

    Once that's worked out the simplest way I can think of to setup drop down 3 is read the choice in drop down 2 by outputing again to a different cell(probably a different cell for each selection in drop down 1), and combine it with the number in drop down 3 and then retrieve data at a hard coded table.

    So can anyone give me some advice on how to tackle this? Thanks in advance!

    D

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    HI,

    This link may help

    http://www.contextures.com/xlDataVal02.html

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    10-06-2006
    Posts
    6
    Quote Originally Posted by VBA Noob
    HI,

    This link may help

    http://www.contextures.com/xlDataVal02.html

    VBA Noob
    Yes it did...I have my three drop down boxes working but now I'm stuck again. Is there a way I can take the info in all three boxes and run a filter (or use some other function) on a table of data and return the output to a single cell? Here is an example. Suppose I pick HNL, 4L and 16 from my three drop downs...I have attached a picture and also a sample .xls sheet to help illustrate. The three drop downs are colored green. The cell that I want the data to end up in is directly below the three green and is colored red. The other red cell is part of a table that I want to reference with the three drop downs and then transfer to the first red cell. More specifically, how to I get excel to look in my HNL 4L column at line 16 (or where ever is selected by the three drop downs) and copy that info to cell B4?
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by derwood; 04-08-2007 at 04:17 PM.

  4. #4
    Forum Contributor
    Join Date
    09-28-2006
    Posts
    122

    try this

    try this formula in b4

    =VLOOKUP(B3,E15:L34,MATCH(B1&" "&B2,E14:L14,0))
    hth

    let me know how you go

  5. #5
    Registered User
    Join Date
    10-06-2006
    Posts
    6
    Quote Originally Posted by peejay
    try this formula in b4



    hth

    let me know how you go
    That is exactly what I was looking for..Thank you very much to both of you. This brings up 2 new questions though.

    First, let's say we pick HNL, 4L and 16. B4 fills with what we want. But suppose we go back to drop down 1 and change it to OGG. Drop down 2 stays 4L even though that isn't an option. Is there a simple function to auto clear drop down 2 when drop down 1 changes? Or better yet, upon selection of drop down 1 can we write something to automatically fill drop down 2 with the first string in its list?

    Secondly, I would like to transfer this to pocket excel but drop down boxes aren't supported. Is there a similar function etc that works in pocket excel that I can use? Or maybe a free add-on to download etc?

    Thanks again!

  6. #6
    Forum Contributor
    Join Date
    09-28-2006
    Posts
    122
    enter the following event code into the VBA editor for sheet1 worksheet change

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Address = "$B$1" Then
    Range("$B$2").ClearContents
    End If
    End Sub
    hth
    let me know how you go

    (sorry I have no idea about the Pocket Excel - Hopefully one of the other's will have some idea)

+ 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