using two comboxes... to populate a third

smartphreak

Board Regular
Joined
Mar 24, 2011
Messages
54
Hey Guys,

I am using one combobox to populate the second.

as follows:
Code:
Private Sub ComboBox_Region_Change()

Select Case Me.ComboBox_Region.Value
Case "NORTH AMERICA"
    Me.ComboBox_Country.RowSource = "NORTHAMERICA"
Case "NORTH AMERICA"
    Me.ComboBox_Country.RowSource = "SOUTHAMERICA"
Case "EUROPE"
    Me.ComboBox_Country.RowSource = "EUROPE"
Case "ASIA"
    Me.ComboBox_Country.RowSource = "ASIA"

End Select
ComboBox_Country.SetFocus

End Sub


Private Sub UserForm_Initialize()
Worksheets("Lists").Range("NORTHAMERICA").Name = "NORTHAMERICA"
Worksheets("Lists").Range("SOUTHAMERICA").Name = "SOUTHAMERICA"
Worksheets("Lists").Range("EUROPE").Name = "EUROPE"
Worksheets("Lists").Range("ASIA").Name = "ASIA"

Worksheets("Lists").Range("REGIONS").Name = "REGIONS"
Me.ComboBox_Region.RowSource = "REGIONS"

End Sub

This works great - only i want to be able to have a third combobox look at the result of combobox_County and populate combobox_location (the 3rd combobox) which is under the named cell USA.

Ie.
Run form
Select "North America" from the combobox_Region
Select "USA" from the combobox_Country
Select a state from the combobox_Location <----- dont know how to populate that

Any ideas?

Thanks a million
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Welcome to MrExcel.

You would do it in the ComboBox_Country_Change event procedure.

By the way, in your UserForm_Initialize procedure why are you assigning the same names to existing names?
 
Upvote 0
Hi Andrew,

Thanks - would i do it in the same fashion as above?

I do not know -it is the way i have always done it... making sure that I assign the same name to my VBA as my named ranges.

smartphreak
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,672
Members
452,937
Latest member
Bhg1984

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top