Consulting

Results 1 to 2 of 2

Thread: combobox2 list dependent on combobox1 sleection

  1. #1

    combobox2 list dependent on combobox1 sleection

    Hey all,

    I have not been able to find a suitable working solution for this...

    I have a userform with the follwoing comboboxes:
    ssComboBox_SelectRegion
    ssComboBox_SelectBranch

    I want to have the region selected and the list for the branch combobox to be populated dependent on which area you select.

    This is the code so far (which is not helpful)...
    Private Sub UserForm_Initialize()
    
    Worksheets("Lists").Range("REGIONS").Name = "REGIONS"
    ssComboBox_SelectRegion.RowSource = "REGIONS"
    Worksheets("Lists").Range("REGION1").Name = "BRANCHLIST1"    
    Worksheets("Lists").Range("REGION2").Name = "BRANCHLIST2"
    Worksheets("Lists").Range("REGION3").Name = "BRANCHLIST3"
    
    End Sub
    Any advice....

    Thanks a million

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    Private Sub ssComboBox_SelectRegion_Change()

    Select Case Me.ssComboBox_SelectRegion.ListIndex

    Case 0: Me.ssComboBox_SelectBranch.RowSource = "REGION1"

    Case 1: Me.ssComboBox_SelectBranch.RowSource = "REGION2"

    Case 2: Me.ssComboBox_SelectBranch.RowSource = "REGION3"
    End Select
    End Sub

    Private Sub UserForm_Initialize()

    ssComboBox_SelectRegion.RowSource = "REGIONS"

    End Sub
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •