Excel Dropdown List with Multiple Selection
In this article
To create an Excel dropdown that lets you select multiple items from the list, you cannot use a standard data validation dropdown alone—it only allows one choice. The practical workaround is to combine a data validation list with a small VBA macro that toggles each selection in the same cell. This guide shows you how to set that up in Microsoft Excel for Windows (the steps are similar on Mac, but the VBA editor opens differently). You'll need Excel desktop (not the web version) and permission to use macros.
What You'll Need
- Excel desktop app (2016 or later; the web version does not support VBA)
- A list of items you want in the dropdown (e.g., in a separate column or sheet)
- Macros enabled in your workbook (you'll save as .xlsm)
Step-by-Step
- Prepare your list of items. In a column (say, column F), type each item you want in the dropdown, one per cell. For example, F1: "Apples", F2: "Bananas", F3: "Carrots".
- Select the cell (or range) where you want the multi-select dropdown. For instance, click on cell A1. If you want the same dropdown in multiple cells, select the entire range now.
- Open Data Validation. Go to the Data tab on the ribbon, then click Data Validation (in the Data Tools group).
- Set up the list. In the Data Validation dialog, under the Settings tab, choose List from the "Allow" drop-down. In the "Source" box, enter the range that contains your items, e.g.,
=F1:F3. Click OK. Now you have a normal single-select dropdown. - Open the VBA editor. Press
Alt+F11on your keyboard (Windows). This opens the Microsoft Visual Basic for Applications window. - Insert a module. In the VBA editor, go to Insert > Module. A blank code window will appear.
- Paste the VBA code. Copy and paste the following code into that module:
Private Sub Worksheet_Change(ByVal Target As Range)
' Multi-select dropdown for cells with data validation list
Dim rng As Range
Dim oldValue As String
Dim newValue As String
' Adjust the range to match your dropdown cells, e.g., "A1:A10"
Set rng = Me.Range("A1:A10")
If Not Intersect(Target, rng) Is Nothing Then
Application.EnableEvents = False
' If cell is empty, just let the change happen
If Target.Value = "" Then
Application.EnableEvents = True
Exit Sub
End If
' Store old value (if any) and new value
oldValue = Target.Value
' If old value already contains the new selection, remove it (toggle)
If InStr(1, oldValue, Target.Value) > 0 Then
newValue = Replace(oldValue, Target.Value, "")
newValue = Application.WorksheetFunction.Trim(Replace(newValue, ",,", ","))
If Left(newValue, 1) = "," Then newValue = Mid(newValue, 2)
If Right(newValue, 1) = "," Then newValue = Left(newValue, Len(newValue) - 1)
Else
' Otherwise append the new selection
If oldValue = "" Then
newValue = Target.Value
Else
newValue = oldValue & ", " & Target.Value
End If
End If
' Update the cell and restore events
Application.EnableEvents = False
Target.Value = newValue
Application.EnableEvents = True
End If
End Sub
- Adjust the range in the code. In the line
Set rng = Me.Range("A1:A10"), changeA1:A10to match the cells where you applied the data validation. If you only used A1, change it to"A1". - Save as macro-enabled workbook. Close the VBA editor (click the X). In Excel, press
Ctrl+S. When saving, choose Excel Macro-Enabled Workbook (*.xlsm) from the file type drop-down. If you save as .xlsx, the macro will be lost. - Test it. Click on the dropdown cell, choose an item from the list. Then click the cell again and choose another item—it should appear after a comma. Click the same item again to remove it.
Common Mistakes
- Forgetting to enable macros. When you open the file, Excel may show a yellow bar asking to enable macros. If you don't click "Enable Content", the macro won't run and the multi-select won't work.
- Using the wrong range in the code. If the code range doesn't match your dropdown cells, the macro won't trigger. Double-check both the data validation range and the
Set rngline. - Saving as .xlsx. This strips the macro. Always save as .xlsm.
- Typing in the cell instead of using the dropdown. The macro works on any change to the cell, but if you type a value that isn't in the list, it will still be added. Use the dropdown to keep things clean.
Tips
- Use a named range for your list. Instead of
=F1:F3, define a name (e.g.,MyList) and use=MyListin the data validation source. This makes it easier to add items later. - Separate selections with a comma and space. The code above uses ", " as the separator. If you prefer a different separator (like a semicolon), adjust the code accordingly.
- Limit the range in the code. If you only need the multi-select in a few cells, keep the range small to avoid unnecessary macro triggers.
- Make a backup. Before adding VBA, save a copy of your workbook as .xlsx in case you need a version without macros.
Troubleshooting
- Nothing happens when I select a second item. Check that macros are enabled (File > Options > Trust Center > Trust Center Settings > Macro Settings > Enable all macros, or just click "Enable Content" when prompted). Also verify the range in the VBA code matches your dropdown cells exactly.
- The dropdown only shows one item at a time. That's normal—the multi-selection is stored as text in the cell, not as a visual list. The dropdown itself will always show the last selected item; the cell will contain all selections separated by commas.
- I get a "Compile error" when opening the VBA editor. Make sure you pasted the code into a module (not a sheet's code window) and that there are no typos. The code above is tested and should work as long as you don't change the structure.
- Selections are not being removed when I click the same item. The toggle logic uses
Replace, which removes all occurrences of the text. If an item's name is a substring of another (e.g., "Apples" and "Green Apples"), it may cause unexpected results. Use distinct item names. - The macro runs but the cell becomes empty. This can happen if the
Application.EnableEvents = Falseline is not restored properly. Ensure the code has bothApplication.EnableEvents = FalseandApplication.EnableEvents = Trueas shown. If you accidentally break the code, close Excel without saving and reopen.
Frequently Asked Questions
Can I do this without VBA?
No, Excel's built-in data validation only allows one selection per cell. VBA is the standard workaround. A non-VBA alternative is to use a separate cell for each selection (e.g., checkboxes) and then combine them with a formula, but that's not a dropdown.
Will this work on Excel for Mac?
Yes, but the VBA editor opens with Option+F11 (or via Tools > Macro > Visual Basic Editor). The code itself works the same.
Can I use this in Google Sheets?
Google Sheets has a built-in multi-select feature in some contexts (like data validation with chips), but not in the same way. For a true multi-select dropdown, you'd need Google Apps Script, which is different from this Excel VBA.
How do I remove all selections from a cell?
Simply select the cell and press Delete or Backspace to clear it. The macro will allow the cell to become empty.
Will this slow down my workbook?
Only if you have a huge range in the code and you're editing many cells. For typical use (a few cells), the impact is negligible.
Can I add more items to the list later?
Yes. Just add the new item to your source range (e.g., F4, F5) and update the data validation source to include those cells. The macro doesn't care about the list content—it only handles the cell changes.