i've written code select multiple options from dropdown...but that is allowing to select the same option again and again...
here is the code which i've written,,,
i've tried like
but it doesn't work... can anyone me in this
here is the code which i've written,,,
Code:
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
Else
Application.EnableEvents = False
newval = target.Value
Application.Undo
oldval = target.Value
target.Value = newval
If target.Column = 7 Then
If oldval = "" Then
Else
If newval = "" Then
Else
target.Value = oldval & "," & newval
End If
End If
End If
End If
exithandler:
Application.EnableEvents = True
End Sub
i've tried like
Code:
If target.Column = 7 Then
If oldval = "" Then
Else
If newval = "" Then
Else
If oldval<>newval Then
target.Value = oldval & "," & newval
Else
MsgBox "Already Selected"
End If
End If
End If