Excel User Group
Microsoft Excel blogs, forums, files. Read, ask questions, provide answers.

Dropdown Lists Connecting to Other Dropdown Lists

Latest post Wed, Jul 9 2008 5:00 AM by ashleybelam. 4 replies.
  • Sat, Jul 5 2008 7:56 AM

    Dropdown Lists Connecting to Other Dropdown Lists

    Hi All,

    I need to connect one drop down menu to another.  Hoping someone can assist here?

    For example, the first question in the spreadsheet (to the end user) is 'What would you like to review?'.  The first dropdown presents two listings - 'Monthly Performance' and 'Weekly Performance'.

    If the user selects, 'Monthly Performance', I want the second dropdown listing (located in the row beneath) to present the relevant options - i.e. June, July, August etc.

    If the user selects, 'Weekly Performance', I want the user to only see weekly periods i.e. 01/07/08-08/07/08 etc in the second dropdown menu.

    Would really appreciate some help on this!

    Cheers,

    Ashley 

     

    Filed under:
    • Post Points: 53
  • Sat, Jul 5 2008 10:00 AM In reply to

    • Nick Hodge
    • Top 10 Contributor
    • Joined on Sun, Dec 23 2007
    • Southampton
    • Posts 336
    • Points 5,771
    • MVP

    Re: Dropdown Lists Connecting to Other Dropdown Lists

    Ashley

    There could be more questions than answers here, but if you are using Combo Boxes from the ActiveX 'controls' collection then I would set up three ranges, called say months, weeks and select (on another hidden sheet would be fine, although I show them for illustration on the same sheet). Set the first combo box's ListFillRange to 'Select' (no quotes) and then use the 1st combo box's change event to set the ListFillrange of the 2nd. Using code like this

    Option Explicit
    
    Private Sub ComboBox1_Change()
    If Me.ComboBox1.Value = "Months" Then
        Me.ComboBox2.ListFillRange = "Months"
    Else
        Me.ComboBox2.ListFillRange = "Weeks"
    End If
    End Sub

     Here are images of the two selections

    Regards
    Nick Hodge
    Microsoft MVP, Excel
    Southampton, UK

    Filed under:
    • Post Points: 5
  • Sat, Jul 5 2008 11:16 AM In reply to

    • Alex J
    • Top 25 Contributor
    • Joined on Wed, Jan 9 2008
    • Posts 21
    • Points 349

    Re: Dropdown Lists Connecting to Other Dropdown Lists

    Regards, Alex J

    • Post Points: 5
  • Sat, Jul 5 2008 2:08 PM In reply to

    Re: Dropdown Lists Connecting to Other Dropdown Lists

    All explained here http://www.contextures.com/xlDataVal02.html

    Regards

    Bob

    • Post Points: 5
  • Wed, Jul 9 2008 5:00 AM In reply to

    Re: Dropdown Lists Connecting to Other Dropdown Lists

     Grateful thanks to everyone for the quick responses. I have implemented your suggestions and i'm happy to say it works very well...

    • Post Points: 5
Page 1 of 1 (5 items) | RSS
Copyright Excel User Group and the relevant contributors, 2008. All Trade Marks acknowledged. This site is a peer-to-peer site and NOT affiliated in any way to Microsoft Corp. All rights reserved.