automatically refresh conditional combo box

delta59

New Member
Joined
Jun 18, 2011
Messages
11
hey I have some code for a set of conditional dropdown boxes. Everything works but I have to manually run the macro to get the values in the drop down box to change. So what I need is for everything to automatically refresh whenever a box is changed, any suggestions?


Private Sub Combo_Change()
ComboBox1.ListFillRange = "Location"
If ComboBox1 = "Cable in Conduit" Then

Worksheets(1).OLEObjects("ComboBox2").ListFillRange = "cable"
ComboBox2.ListIndex = 0
If ComboBox2 = "1/0 AL" Then
Worksheets(1).OLEObjects("ComboBox3").ListFillRange = "cableone"
ComboBox3.ListIndex = 0
End If
If ComboBox2 = "3/0 AL" Then
Worksheets(1).OLEObjects("ComboBox3").ListFillRange = "cablethree"
ComboBox3.ListIndex = 0
End If
If ComboBox2 = "750 AL" Then
Worksheets(1).OLEObjects("ComboBox3").ListFillRange = "cableseven"
ComboBox3.ListIndex = 0
End If
If ComboBox2 = "1000 AL" Then
Worksheets(1).OLEObjects("ComboBox3").ListFillRange = "cablethousand"
ComboBox3.ListIndex = 0
End If
End If


If ComboBox1 = "Direct Bury" Then

Worksheets(1).OLEObjects("ComboBox2").ListFillRange = "direct"
ComboBox2.ListIndex = 0
If ComboBox2 = "1/0 AL" Then
Worksheets(1).OLEObjects("ComboBox3").ListFillRange = "directone"
ComboBox3.ListIndex = 0
End If
If ComboBox2 = "3/0 AL" Then
Worksheets(1).OLEObjects("ComboBox3").ListFillRange = "directthree"
ComboBox3.ListIndex = 0
End If
If ComboBox2 = "750 AL" Then
Worksheets(1).OLEObjects("ComboBox3").ListFillRange = "directseven"
ComboBox3.ListIndex = 0
End If
If ComboBox2 = "1000 AL" Then
Worksheets(1).OLEObjects("ComboBox3").ListFillRange = "directthousand"
ComboBox3.ListIndex = 0
End If
End If


If ComboBox1 = "Duct Bank" Then

Worksheets(1).OLEObjects("ComboBox2").ListFillRange = "duct"
ComboBox2.ListIndex = 0
If ComboBox2 = "1/0 AL" Then
Worksheets(1).OLEObjects("ComboBox3").ListFillRange = "ductone"
ComboBox3.ListIndex = 0
End If
If ComboBox2 = "3/0 AL" Then
Worksheets(1).OLEObjects("ComboBox3").ListFillRange = "ductthousand"
ComboBox3.ListIndex = 0
End If

End Sub
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Forum statistics

Threads
1,215,391
Messages
6,124,673
Members
449,178
Latest member
Emilou

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