Populating combobox/listbox

  • Thread starter Thread starter Torstein S. Johnsen
  • Start date Start date
T

Torstein S. Johnsen

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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top