View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rob van Gelder[_4_] Rob van Gelder[_4_] is offline
external usenet poster
 
Posts: 1,236
Default Populating combobox/listbox

Here's an example:

Private Sub CommandButton1_Click()
Dim rng As Range

For Each rng In Range("A1:A20")
ComboBox1.AddItem rng.Value
Next
End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Torstein S. Johnsen" wrote in message
...
This topic has certainly been answered before, but I'm not able to find an
answer.

How do you populate list/comoboxes via VBA in Excel. I want to populate

the
box with all the elements in a range. Is there web-site that gives good
information about userforms and listboxes in excel?

Torstein S. Johnsen