View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein \(MVP - VB\)[_1353_] Rick Rothstein \(MVP - VB\)[_1353_] is offline
external usenet poster
 
Posts: 1
Default Same Items in 3 different Combo Boxes

You could do it this way...

Dim S As Variant
For Each S In Split("AL AK AZ AR CA CO CT DE FL GA HI ID IL IN IA " & _
"KS KY LA ME MD MA MI MN MS MO MT NE NV NH NJ " & _
"NM NY NC ND OH OK OR PA RI SC SD TN TX UT VT " & _
"VA WA WV WI WY")
ListBox1.AddItem S
ListBox2.AddItem S
ListBox3.AddItem S
Next

Rick


"RyanH" wrote in message
...
I have three Combo Boxes in a UserForm that I need to display all 50 state
initials. I usually write my code like this:

Private Sub UserForm_Initialize()

With cboCustomerST
.AddItem "GA"
.AddItem "TN"
.AddItem "NY"
'list all other state
End With

End Sub

Is there a faster way to do this with 2 other combo boxes instead writing
code for each combo box?

Thanks in Advance,
Ryan