How can I add items through code to a combobox?
I tryed this
Do Until adorecordset1.EOF
cmbLocation.??? = adorecordset1("Location"
adorecordset1.MoveNext
Loop
This example adds a combo box control to a command bar. Two items are added to the control, and the number of line items and the width of the combo box are set.
Set myBar = CommandBars("Custom"
Set myControl = myBar.Controls.Add(Type:=msoControlComboBox, Id:=1)
With myControl
.AddItem "First Item", 1
.AddItem "Second Item", 2
.DropDownLines = 3
.DropDownWidth = 75
.ListHeaderCount = 0
End With
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.