In Excel:
In VBA:
Sub populate_combobox() 'Procedure to populate a combobox located in a userformDim item As Range
With UserForm1.Controls("ComboBox1") 'To
.Clear 'Remove previous loaded values
For Each item In Sheets(1).Range("Mycomboboxlist").Cells 'Go through all the cells of a named range
.AddItem (item.Value) 'To populate the combobox with a value
Next
End With
UserForm1.Show 'To display the userform
End Sub
No comments:
Post a Comment