Hello! I'm attempting to use a drop down list for requests to update a row of data. The drop down list options are in Column A2:A8 in my sample data. I would like to make the multiple select drop down in Column C. There may be more rows of data at any given time. I'm trying to select all types of updates that are needed for each row. I only entered $C$2 in the VBA Code. However, I need it to include Column C. I used VBA Code below but nothing happens when I test it. I would appreciate help to correct this code that I found in a tutorial.
Private Sub Worksheet_Change(ByVal Target As Range)
' Initializing variables
Dim oldVal As String
Dim newVal As String
' Checking for changes in the drop down lists
Application.EnableEvents = True
If Target.Address = "$C$2" Then
If Target.SpecialCells(xlCellTypeAllValidation) Is Nothing Then
Exit Sub
' Adding the multiple selected items to the list
Else
If Target.Value = "" Then
Exit Sub
Else
Application.EnableEvents = False
newVal = Target.Value
Application.Undo
oldVal = Target.Value
If oldVal = "" Then
Target.Value = newVal
Else
If InStr(oldVal, newVal) = 0 Then
Target.Value = oldVal & ", " & newVal '& vbNewLine &
Else
Target.Value = oldVal
End If
End If
End If
End If
End If
Application.EnableEvents = True
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
' Initializing variables
Dim oldVal As String
Dim newVal As String
' Checking for changes in the drop down lists
Application.EnableEvents = True
If Target.Address = "$C$2" Then
If Target.SpecialCells(xlCellTypeAllValidation) Is Nothing Then
Exit Sub
' Adding the multiple selected items to the list
Else
If Target.Value = "" Then
Exit Sub
Else
Application.EnableEvents = False
newVal = Target.Value
Application.Undo
oldVal = Target.Value
If oldVal = "" Then
Target.Value = newVal
Else
If InStr(oldVal, newVal) = 0 Then
Target.Value = oldVal & ", " & newVal '& vbNewLine &
Else
Target.Value = oldVal
End If
End If
End If
End If
End If
Application.EnableEvents = True
End Sub