You can write it a couple of ways:
Me.ComboBox1.List = myRng
or:
UserForm1.ComboBox1.List = myRng
the user form has to be included to tell the compiler where to look for the
combobox. Also you have to tell it which combobox you are referring to.
Tthe control name must be specific so VBA knows which one to look at. As you
add and delete controls, VBA will automatically name them sequentially, but
you can change the names to something more recognizable by you that maybe
tells you what the control does. You can then use that name in your code
instead of combobox1, combobox2, etc.
Excel User said:
Dave,
I'm alittle lost, I've tried :
Dim myRng As Range
myRng = myRange.Value
'where myRange is a named range on a sheet named 'item list'
ComboBox.List = myRng
but I get an error message.
Run-time error '424'
Object required
Not sure what I am doing wrong?