Runtime error 424, Object required - while populating ComboBoxes

Ajain

New Member
Joined
Dec 27, 2010
Messages
1
Hello Everyone,


I have 2 Activex ComboBoxes on a sheet and I am trying to populate the range in the 2nd combobox based on the value in the first combobox.
Here is my code. But whenever I run it, I get the following error:
"Runtime error 424, Object required" .. Please Help!
Note: Linked Cell for ComboBox1 is D1


Code:
<code>Private Sub ComboBox1_Change()
    Dim SubType As String
    SubType = Range("$D$1").Value
    Select Case SubType
        Case "Fruits"
          ComboBox2.ListFillRange = "Fruits_Range"
        Case "Vegetables"
            ComboBox2.ListFillRange = "Veg_Range"
    End Select
End Sub
</code>
I defined Fruits_Range and Veg_Range using Formula > Name Manager
Here is the logic: If someone selects "Fruits" from the 1st List box, then I would like to display a list of fruits in the 2nd box.


I know I could do pretty much the same thing using Data Validation Lists, but my boss would like me to use ActiveX ComboBoxes and dont ask me why! :)


Quick help would be much appreciated.
Thanks,
Ajain



My Excel Version: Excel 2007
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
This doesn't help much but that code works for me without error.
 
Upvote 0

Forum statistics

Threads
1,215,025
Messages
6,122,732
Members
449,093
Latest member
Mnur

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