Drop-down lists

P

Pierraud

How can I have the system select more than one item (or cell) from a
drop-down list. Different items can be selected from the same list but the
system will not allow me to add more than one.
 
A

Anne Troy

Dropdowns are generally created using Data-Validation. Using this method,
you cannot select multiple options. You'll need a listbox or combobox.

Here's some sample code:
Sub FindItems()

Dim Msg As String, i As Integer
Msg = ""
With TestDialog.ListBox1
For i = 0 To .ListCount - 1
If .Selected(i) Then
Msg = Msg & .List(i) & Chr(13)
End If
Next i
End With
MsgBox Msg, , "Selected items in ListBox1"
End Sub

________________________

**** Hope it helps! ****

~Dreamboat
Excel VBA Certification Coming Soon!
www.VBAExpress.com/training/
********************************
 

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

Top