PDA

View Full Version : combobox2 list dependent on combobox1 sleection



smartphreak
09-29-2010, 07:55 AM
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

Bob Phillips
09-29-2010, 09:04 AM
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