View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Jim Cone[_2_] Jim Cone[_2_] is offline
external usenet poster
 
Posts: 1,549
Default Form Help - ComboBox - VBA


Private Sub UserForm_Initialize()
Dim varList As Variant
varList = Array("LDC", "DC", "DB", "LDDB", "XmasDB", "XmasLDDB", _
"XmasDC", "XmasLDC", "No Die", "Same Die As")
CmbxFirst.List = varList
CmbxSecond.List = varList
End Sub
--
Jim Cone
Portland, Oregon USA


"jlclyde"

wrote in message
I have a form and when I initialize the form I need multiple combo
boxes to fill in with the same data. Is there an easier way then
doing .additem for each one? My code below.
Thanks Jay

Private Sub UserForm_Initialize()
With CmbxFirst 'this loads the combo
.AddItem "LDC"
.AddItem "DC"
.AddItem "DB"
.AddItem "LDDB"
.AddItem "XmasDB"
.AddItem "XmasLDDB"
.AddItem "XmasDC"
.AddItem "XmasLDC"
.AddItem "No Die"
.AddItem "Same Die As"
End With
With CmbxSecond 'this loads the combo
.AddItem "LDC"
.AddItem "DC"
.AddItem "DB"
.AddItem "LDDB"
.AddItem "XmasDB"
.AddItem "XmasLDDB"
.AddItem "XmasDC"
.AddItem "XmasLDC"
.AddItem "No Die"
.AddItem "Same Die As"
End With