A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Try the below code example. In the Case statement simply edit with the columns to which you require the data validation multi select to be applied
Reason for using Select Case in lieu of If statements is that the Case can have one or multiple conditions with the column numbers as per the example.
Note that lngCol is used in the following line of code
If Not Intersect(Target, Columns(lngCol)) Is Nothing Then
Modified/Additional code in bold.
Private Sub Worksheet_Change(ByVal Target As Range) 'Code by Sumit Bansal from https://trumpexcel.com
' To Select Multiple Items from a Drop Down List in Excel Dim Oldvalue As String
Dim Newvalue As String
Dim Oldvalue As String
Dim lngCol As Long
lngCol = Target.Column
Select Case lngCol
Case 3, 5, 7, 8, 9 'Edit with the required column numbers separated with commas
If Not Intersect(Target, Columns(lngCol)) Is Nothing Then 'Mike H’s code which made things happen for the entire column
If Target.SpecialCells(xlCellTypeAllValidation) Is Nothing Then
GoTo Exitsub
Else: If Target.Value = "" Then GoTo Exitsub Else
Application.EnableEvents = False
Newvalue = Target.Value
Application.Undo
Oldvalue = Target.Value
If Oldvalue = "" Then
Target.Value = Newvalue
Else
Target.Value = Oldvalue & ", " & Newvalue
End If
End If
End If
End Select
Application.EnableEvents = True
Exitsub:
Application.EnableEvents = True
End Sub