Ok, you're trying to comply and you're new, so I'll help you out.
Here's the original:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim oldVal As String
Dim newVal As String
If Target.Address(0, 0) <> "E40" Then Exit Sub
On Error GoTo ReEnable
Application.EnableEvents = False
newVal = Target.Value
Application.Undo
oldVal = Target.Value
Target.Value = newVal
If oldVal <> "" And newVal <> "" Then
Target.Value = oldVal & ", " & newVal
End If
ReEnable: Application.EnableEvents = True
End Sub
And here's the code modified to your request:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim oldVal As String
Dim newVal As String
If Not Intersect(Range("E40:E350"), Target) Is Nothing Then
On Error GoTo ReEnable
Application.EnableEvents = False
newVal = Target.Value
Application.Undo
oldVal = Target.Value
Target.Value = newVal
If oldVal <> "" And newVal <> "" Then
Target.Value = oldVal & ", " & newVal
End If
End If
ReEnable: Application.EnableEvents = True
End Sub
Bookmarks