+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    06-03-2009
    Location
    N.Ireland
    MS-Off Ver
    Excel 2003
    Posts
    76

    Populate dropdown list based on a selection from another (Useful Example)

    Here is a useful (Simple) example of a dropdown list based on the selection from another if anyone is interested. The first example uses just the datasheet and the second uses a userform with a dropdown list:
    Attached Files Attached Files
    Last edited by PRodgers; 06-15-2009 at 12:34 PM.

  2. #2
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,379

    Re: Populate dropdown list based on a selection from another (Useful Example)

    First point of call for info re:data validation would be Contextures:

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

  3. #3
    Forum Contributor
    Join Date
    09-27-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    158

    Re: Populate dropdown list based on a selection from another (Useful Example)

    I dont seem to be able to open the matchimg combos2.zip file can you give me any advice

  4. #4
    Registered User
    Join Date
    10-01-2011
    Location
    Manila, Philippines
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Populate dropdown list based on a selection from another (Useful Example)

    Quote Originally Posted by Mooseman60 View Post
    I dont seem to be able to open the matchimg combos2.zip file can you give me any advice
    Please see the attached file.
    Attached Files Attached Files
    Paalam.

  5. #5
    Forums Administrator royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    24,421

    Re: Populate dropdown list based on a selection from another (Useful Example)

    For the UserForm removing the need for Dynamic Named Ranges
    Code:
    Option Explicit
    
    Private Sub ComboBox1_Change()
        Dim iCol As Integer
        If Me.ComboBox1.ListIndex > -1 Then
            iCol = Me.ComboBox1.ListIndex + 2
            With Sheet1
                Me.ComboBox2.List = .Range(.Cells(2, iCol), .Cells(2, iCol).End(xlDown)).Value
            End With
        End If
    End Sub
    Hope that helps.

    RoyUK
    --------
    If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need

    For Excel consulting, free examples and tutorials visit Excel Consulting-Excel VBA
    Check out the free Excel Toolbar

    New members please read & follow the Forum Rules

    Remember to mark your questions Solved and rate the answer(s)


    Code Tags: Make your code easier for us to read

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.2.0