View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Jeremy Jeremy is offline
external usenet poster
 
Posts: 184
Default Selecting multiple items from a drop down list

I have a small drop down list with only 4 items. I want to be able to allow
the users to choose more than one of these items. I tried using this code
Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rngDV As Range
Dim oldVal As String
Dim newVal As String
If Target.Count 1 Then GoTo exitHandler

On Error Resume Next
Set rngDV = Cells.SpecialCells(xlCellTypeAllValidation)
On Error GoTo exitHandler

If rngDV Is Nothing Then GoTo exitHandler

If Intersect(Target, rngDV) Is Nothing Then
'do nothing
Else
Application.EnableEvents = False
newVal = Target.Value
Application.Undo
oldVal = Target.Value
Target.Value = newVal
If Target.Column = 3 Then
If oldVal = "" Then
'do nothing
Else
If newVal = "" Then
'do nothing
Else
Target.Value = oldVal _
& ", " & newVal
End If
End If
End If
End If

exitHandler:
Application.EnableEvents = True
End Sub
that I got from this site:
(http://www.contextures.com/excelfiles.html) (scroll down to Select Mulitple
Items from a drop down list).

However, after right clicking and pasting in the code, I still don't have
the option of choosing more than one option in my drop down list. I know
nothing about code, so I'd appreciate any help that can be delivered with
that constraint!

Thanks.