Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Excel Drop Down List Multi Select: A Complete Guide

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Excel does not have a built-in "multi-select" toggle for data validation lists; by default, selecting a new item from a drop-down menu replaces the existing value. To achieve multi-select functionality, you must use a small piece of VBA (Visual Basic for Applications) code that tells Excel to append new selections to the existing cell content rather than overwriting them. This allows you to create tags, category lists, or multi-choice survey responses within a single cell.

What You'll Need

  • Microsoft Excel for Windows or Mac (Note: VBA does not work in Excel for the Web/Online).
  • A basic list of items to serve as your drop-down options.
  • The "Developer" tab enabled in your Excel Ribbon.
  • A workbook saved in the .xlsm (Excel Macro-Enabled Workbook) format.

Step-by-Step

  1. Create Your Source List: On a separate worksheet (e.g., Sheet2), type the list of items you want to appear in your drop-down menu. For example, if you are tracking project tags, list "Urgent," "Pending," "Completed," and "Review" in a single column.
  2. Set Up Data Validation: Go to the worksheet where you want the drop-down to appear. Select the cell or range of cells. Go to the Data tab > Data Validation. Under the "Allow" menu, select List. In the "Source" box, highlight the range of items you created in Step 1. Click OK. You now have a standard single-select drop-down.
  3. Enable the Developer Tab: If you do not see the Developer tab at the top of your screen, right-click anywhere on the Ribbon and select Customize the Ribbon. In the right-hand list, check the box next to Developer and click OK.
  4. Open the VBA Editor: Right-click the sheet tab name at the bottom of your screen (e.g., "Sheet1") where your drop-down lists are located. Select View Code. This opens the Visual Basic for Applications editor window specifically for that worksheet.
  5. Insert the Multi-Select Code: Copy and paste the following code into the white window. This script monitors changes in the worksheet; if a cell with data validation is changed, it adds the new value to the old one, separated by a comma.
    Private Sub Worksheet_Change(ByVal Target As Range)
        Dim Oldvalue As String
        Dim Newvalue As String
        On Error Resume Next
        If Target.Column = 1 Then
            If Target.SpecialCells(xlCellTypeAllValidation) Is Nothing Then
                Exit Sub
            Else
                If Target.Value = "" Then GoTo Exitsub
                Application.EnableEvents = False
                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
                Application.EnableEvents = True
            End If
        End If
    Exitsub:
        Application.EnableEvents = True
    End Sub
  6. Customize the Column Range: In the code above, look for the line If Target.Column = 1 Then. The number "1" represents Column A. If your drop-downs are in Column B, change this to 2; for Column C, use 3, and so on. If you want this to work across the entire sheet regardless of the column, you can remove this specific If and End If wrapper.
  7. Save as Macro-Enabled: Close the VBA window to return to Excel. Go to File > Save As. In the file type drop-down, you must select Excel Macro-Enabled Workbook (.xlsm). If you save it as a standard .xlsx file, the multi-select code will be deleted.
  8. Test the Functionality: Click your drop-down cell and select an item. Then, click the same cell again and select a second item. The cell should now display both items separated by a comma.

Common Mistakes

  • Saving as .xlsx: This is the most frequent error. Standard Excel workbooks strip out all VBA code upon saving. Always ensure the extension is .xlsm.
  • Incorrect Column Index: Users often paste the code but forget to change Target.Column = 1 to match the actual column where their drop-downs reside. If the code doesn't trigger, check your column number.
  • Overlapping Data Validation: Trying to apply this to cells that don't have Data Validation lists set up. The code is designed to check for xlCellTypeAllValidation; if the cell is just a blank cell without a list, the script will ignore it.
  • Ignoring Security Warnings: When you reopen the file, Excel will show a yellow bar saying "Macros have been disabled." You must click Enable Content for the multi-select functionality to work.

Tips

  • Preventing Duplicates: The provided code includes an InStr check. This prevents the same item from being added multiple times to the same cell. If you select "Urgent" twice, it will only appear once.
  • Changing the Separator: If you prefer a semi-colon or a line break instead of a comma, change the ", " part of the code. To use a line break (which requires "Wrap Text" to be enabled in the cell), use vbCrLf instead of the comma string.
  • Clearing the Cell: To start over, simply select the cell and press the Delete key. The code is written to handle empty values (via If Target.Value = "" Then GoTo Exitsub), so it won't crash when you clear the cell.
  • Using Named Ranges: Instead of highlighting a range for your source list (e.g., Sheet2!$A$1:$A$10), create a Named Range (Formulas > Define Name). This makes your data validation more robust if you move the source list to a different location.

Troubleshooting

If the multi-select is not working, first check if Enable Events has been accidentally turned off. VBA uses Application.EnableEvents to prevent infinite loops. If a script crashes midway, Excel might leave this setting as "False," meaning no further macros will trigger. To fix this, press Alt + F11, open the Immediate Window (Ctrl + G), type Application.EnableEvents = True, and press Enter.

If you are getting a "Runtime Error," check that you haven't protected the worksheet. VBA cannot modify a cell's value if the sheet is protected unless the code is specifically written to unprotect and reprotect the sheet during the process. Try unprotecting the sheet via the Review tab and testing again.

If the drop-down menu is missing entirely, ensure that the Data Validation settings are still active. Sometimes, copying and pasting cells from other parts of the workbook can overwrite the Data Validation rules of the target cell.

Frequently Asked Questions

Does this work in Excel for the Web?

No. Excel for the Web does not support VBA macros. For browser-based multi-select, you would need to use Power Apps or a third-party add-in, as the standard web version only supports single-selection lists.

Can I use this on a Mac?

Yes, VBA is supported on Excel for Mac. However, the interface for the VBA editor looks slightly different, and you must ensure that macros are enabled in your Excel Privacy settings.

How do I remove an item from a multi-select cell?

Since the VBA code simply appends text, there is no "uncheck" mechanism. To remove a specific item, you must manually click into the cell (or use the formula bar) and delete the unwanted text and the accompanying comma.

Will this slow down my workbook?

For most users, no. The script only runs when a cell is changed. However, if you apply this to a sheet with thousands of rows and complex calculations, you may notice a slight lag during data entry because the script triggers an "Undo" and "Redo" action to capture the old value.

Can I limit the number of selections?

Yes, but it requires adding a counter to the VBA code. You would need to use the Split function to count the number of commas currently in the cell and add an If statement to block the addition of a new value if the count exceeds your limit.