selecting multiple choices from a drop down list

R

robparkes

I have a drop down list in a cell and I want to be able to selec
multiple entries from that list.

Does anyone know how I go this
 
D

Debra Dalgleish

If this is a data validation list, you could use code to compile a list
of selected items. For example, if the data validation is in column C,
the following code will store the selected items in the same row in
column D:
'=============================
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rngDV As Range
Application.EnableEvents = False
If Target.Count > 1 Then Exit Sub

On Error Resume Next
Set rngDV = Cells.SpecialCells(xlCellTypeAllValidation)
On Error GoTo 0
If rngDV Is Nothing Then Exit Sub
If Intersect(Target, rngDV) Is Nothing Then
'do nothing
Else
If Target.Column = 3 Then
If Target.Value = "" Then Exit Sub
If Target.Offset(0, 1).Value = "" Then
Target.Offset(0, 1).Value = Target.Value
Else
Target.Offset(0, 1).Value = _
Target.Offset(0, 1).Value _
& Chr(10) & Target.Value
End If
End If
End If
Application.EnableEvents = True
End Sub
'=========================
 
J

jeff

Hi,

If you're not using data validation, that is, something
like a combobox, you could use code like this to store
two selections (expand on this if you need to) in A1 & A2;

Dim home As Integer

Private Sub ComboBox1_Change()
If home = 1 Then
home = 2
Range("A2").Value = ComboBox1.Value
Else
home = 1
Range("A1").Value = ComboBox1.Value
End If
End Sub


jeff
 
Top