An implementation of Visual Basic that is built into Microsoft products.
Run Application.EnableEvents = True in the VBA Immediate window first, because the drop-down reverting to normal single-select behavior indicates that the Worksheet_Change event is not currently executing.
Restore Excel events
- Press Alt+F11 to open the Visual Basic Editor.
- Press Ctrl+G to open the Immediate window.
- Enter the following and press Enter:
Application.EnableEvents = True
- Return to Excel and select another drop-down item.
Application.EnableEvents controls whether Excel raises events such as Worksheet_Change.^1^ Your procedure temporarily sets it to False; if execution was interrupted while debugging, Excel could have remained in that state for the current session.
Make the event handler safer
Replace the existing handler with the following, adjusting C2:C124 to the cells containing the drop-downs:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Const SEP As String = ", "
Dim oldValue As String, newValue As String
On Error GoTo CleanUp
If Target.CountLarge > 1 Then Exit Sub
If Intersect(Target, Me.Range("C2:C124")) Is Nothing Then Exit Sub
If Target.Validation.Type <> xlValidateList Then Exit Sub
newValue = CStr(Target.Value2)
If Len(newValue) = 0 Then Exit Sub
Application.EnableEvents = False
Application.Undo
oldValue = CStr(Target.Value2)
If Len(oldValue) = 0 Then
Target.Value2 = newValue
ElseIf InStr(1, SEP & oldValue & SEP, _
SEP & newValue & SEP, vbTextCompare) = 0 Then
Target.Value2 = oldValue & SEP & newValue
Else
Target.Value2 = oldValue
End If
CleanUp:
Application.EnableEvents = True
End Sub
Place this code in the worksheet module, not in a regular module:
- Right-click the relevant worksheet tab.
- Select View Code.
- Paste the code there.
- Save the workbook.
A single worksheet event can manage multiple drop-down cells, and each cell retains its own selections.^2^ Worksheet_Change runs when a user changes a worksheet cell; it does not run for changes caused only by recalculation.^3^
If it still selects only one item
Check these conditions in order:
- Workbook format: It must remain an Excel macro-enabled workbook (
.xlsm). Saving as.xlsxremoves VBA. - Macros blocked: If Excel displays a security warning, select Enable Content only if this is your workbook and you trust its code. Alternatively, check File → Options → Trust Center → Trust Center Settings → Macro Settings. Microsoft recommends enabling macros only for trusted files.^4^
- Correct worksheet module: Confirm the procedure is under the sheet containing the drop-down cells, rather than
Module1orThisWorkbook. - Correct range: Change
C2:C124in the replacement code to the actual drop-down range. For noncontiguous cells, use:
If Intersect(Target, Me.Range("C2:C20,E2:E20,G5")) Is Nothing Then Exit Sub
Excel data-validation lists are natively single-select; the multiple-value behavior depends entirely on the VBA event running.^5^
References
- Application.EnableEvents property (Excel)
- In Excel, I am in need of having more than one dropdown list in a worksheet, and I must be able to make multiple selections in each one. - Microsoft Q&A
- Worksheet.Change event (Excel)
- Enable or disable macros in Microsoft 365 files | Microsoft Support
- How to set multiple select dropdown in Excel using C# DocumentFormat.OpenXml library? - Microsoft Q&A