Problem Populating a ComboBox
I stand corrected. I always create my forms manually, so I have more to
learn in doing them by code.
"Jim Cone" wrote:
On the other hand, this worked for me...
(assumes "Sheet2" is the name of the sheet containing the data)
'--
Public Sub Create_Supplier_List_R1()
Dim cb As OLEObject
Set cb = ActiveSheet.OLEObjects.Add(ClassType:="Forms.Combo Box.1", _
Link:=False, DisplayAsIcon:=False, Left:=48.75, Top:=53.25, _
Width:=159, Height:=18.75)
cb.ListFillRange = "Sheet2!C2:C6"
End Sub
--
Jim Cone
Portland, Oregon USA
"Gary Kie"
wrote in message
When using the following code I get the error "Object doesn't support this
property or Method"
Public Sub Create_Supplier_List()
Set cb = ActiveSheet.OLEObjects.Add(ClassType:="Forms.Combo Box.1",
Link:=False, _
DisplayAsIcon:=False, Left:=48.75, Top:=53.25, Width:=159,
Height:=18.75)
Sheets(2).cb.ListFillRange = Sheets(2).Range("C2:C6")
End Sub
Please can you assist me with my problem.
|