Hello,

I am trying to create a dropdown where I can select multiple values in the same cell. The values could be big in number.
I have a Macro to do this but it is super slow and keeps crashing my excel sheet.

Could anyone help me fixing this code or just provide new code if you guys have any. I am using MAC Office 2016

Below is the code which I am using but it crashes the excel sheet...

Private Sub Worksheet_Change(ByVal Target As Range)

Dim Oldvalue As String
Dim Newvalue As String

On Error GoTo Exitsub
If Target.Column > 3 And Target.Column < 9 Then
If Target.SpecialCells(xlCellTypeAllValidation) Is Nothing Then
GoTo Exitsub
Else: If Target.Value = "" Then GoTo Exitsub Else
Application.EnableEvents = True
Newvalue = Target.Value
Application.Undo
Oldvalue = Target.Value
If Oldvalue = "" Then
Target.Value = Newvalue
Else
If InStr(1, Oldvalue, Newvalue) = 0 Then
Target.Value = Oldvalue & ", " & Newvalue
Else
Target.Value = Oldvalue
End If
End If
End If
End If
Application.EnableEvents = True

Exitsub:
Application.EnableEvents = True

End Sub