Home > Validation > Drop Downs > Multiple Selection

Excel Drop Down Multiple Selections

Debra Dalgleish - Contextures

Put multiple selections in a cell, with an Excel drop down list. My short video shows how the Excel multi select dropdown works, and get my Excel file to try it out!

drop down list in excel with multiple selections

A1) Drop Down List Multiple Selections

Put multiple selections in a cell, with an Excel drop down list. My short video shows how the Excel multi select dropdown works, and get my Excel file to try it out!

A2) Start: Basic Drop Down List

In the the Multi Select sample file, there is a basic drop down list on the worksheet named "Single". In the Staff column, shown below:

  • You can select any name from the drop down list.
  • If you select a different name, it replaces any previous selection in the cell.

drop down list in excel with multiple selections

A3) Make Multi Select Drop Down List

After you build a basic drop-down list, you can change it to a multiple selection drop down. When you select another name, it's added in the active cell, after any existing nems.

drop down list in excel with multiple selections

There are 5 steps to set this up, and the step-by-step details are in the sections below:

  1. Go to Code: Go to the multiple selection macro code
  2. Copy Code: Copy the multiple selection macro code
  3. Paste Code: Paste the code into a different worksheet or workbook
  4. Test Drop Down: Test the drop down
  5. Save File: Save your Excel file as macro enabled

Tip: You can practise this setup in my Multi Select sample file. Later, do the same steps in your own Excel file.

  • Important: Remember to make a backup copy of your Excel files, before adding code, or making any other big changes to the files.

Step a) Go to the Multi Select Code

In the Multi Select sample file, on the Multi sheet, there a multiple selection drop down list, in column C.

In the screen shot below, I've already selected 2 names in cell C3, and I'm adding another name.

drop down list in excel with multiple selections

The Multi sheet has a background macro, that runs automatically, when you make a change on the Multi sheet.

  • To see the macro code, right-click the Multi sheet tab, and click on View Code.

right-click sheet tab click View Code

The Excel Visual Basic for Applications (VBA) window will open.

project explorer and code window

  1. At the left, there is a Project Explorer window, that shows all the Excel files that are open. (The list includes hidden files, such as add-ins)
    • The Multi sheet, in the sample file, is highlighted in that list
  2. In the big Code window at the right, you can see the code for the Multi sheet
    • The code that allows multiple selections starts a the "Private Sub Worksheet Change" line

Step b) Copy Multi Select Code

To copy the Multi sheet code onto the Single sheet, follow these steps:

  • Click anywhere on the Code window
  • On your keyboard, press Ctrl + A, to select all the code
  • Press Ctrl + C, to copy all the selected code

Step c) Paste Multi Code on Another Sheet

To paste the Multi sheet code onto the Single sheet, follow these steps:

  • In the Project Explorer window, right-click on the Single sheet, and click View Code

A) No Code: If the code window is empty, or just has an Option Explicit line, follow these steps:

  • Click anywhere on the Code window
  • Press Ctrl + A, to select all the code
  • Right-click on the Code window, and click Paste, in the pop-up menu
  • To close the VBA window, and return to Excel, press Alt + Q.

right-click code window and click paste

B) Existing Code: If the code window has anything more than an Option Explicit line, do NOT delete the existing code!

  • If you understand the code that is on the worksheet AND there is NO existing Worksheet_Change procedure
    • you could paste the copied code at the end of the existing code
    • Then, delete the Option Explicit line from the pasted code
  • Otherwise, ask someone proficient with Excel VBA code to help you
  • To close the VBA window, and return to Excel, press Alt + Q.

Step d) Test the Code

After you add the code to the Single sheet, be sure to test it.

  • Go to the Single sheet, and select a name from the drop down list
  • Next, in the same cell, select a different name from the drop down.

The code should run automatically when you make a change to the worksheet, and add the new name in the same cell.

drop down list allows multiple selections

Step e) Save File as Macro-Enabled

The final step is to save the file in a macro-enabled format, if you haven't done that already.

To save as macro enabled, follow these steps:

  • At the top left of Excel, click the File button
  • In the list at the left, click Save As
  • Type a name for the workbook, e.g. DataValMultiSelect
  • In the drop down list for file type, select:
    • Excel Macro-Enabled Workbook (*.xlsm)
    • OR Excel Binary Workbook (*.xlsb)
  • save the file in a macro-enabled format
  • (optional) To save the file in a different folder, click the Browse button, and select a new location
  • Finally, click the Save button.

Note: Later, when you open the workbook, you might have to enable macros in order to use this macro code.

B1) Multiple Selection Macro Code

The following code example should be copied onto each worksheet module where you want to use the multiple selection technique. This code adds multiple items in the active cell, separated by a comma.

There are many more code examples in the sample workbooks that you can download below.

  ▶

Note: This code does not work if the sheet is protected. Be sure to unprotect the sheet before running this macro.

Private Sub Worksheet_Change(ByVal Target As Range)
' Developed by Contextures Inc.
' www.contextures.com
Dim rngDV As Range
Dim oldVal As String
Dim newVal As String
Dim dvCol As Long
Dim mySep As String
dvCol = 3
mySep = ", " If Target.Count > 1 Then GoTo exitHandler On Error Resume Next Set rngDV = Cells.SpecialCells(xlCellTypeAllValidation) On Error GoTo exitHandler If rngDV Is Nothing Then GoTo exitHandler If Intersect(Target, rngDV) Is Nothing Then 'do nothing Else Application.EnableEvents = False newVal = Target.Value Application.Undo oldVal = Target.Value Target.Value = newVal If Target.Column = 3 Then If oldVal = "" Then 'do nothing Else If newVal = "" Then 'do nothing Else Target.Value = oldVal _ & ", " & newVal ' NOTE: you can use a line break, ' instead of a comma ' Target.Value = oldVal _ ' & Chr(10) & newVal End If End If End If End If exitHandler: Application.EnableEvents = True End Sub

B2) Code on Protected Worksheet

If the worksheet is protected, the Cells.SpecialCells(xlCellTypeAllValidation) code will not work. Instead, you can check the .Validation.Type property of the target cell, to see if it contains a drop down list.

This example is on the SameCellProtect sheet in the sample file. It is set up to work on column 3 only.

Private Sub Worksheet_Change(ByVal Target As Range)
' Developed by Contextures Inc.
' www.contextures.com
'code runs on protected sheet
Dim oldVal As String
Dim newVal As String
Dim strType As Long
Dim dvCol As Long
Dim mySep As String
dvCol = 3
mySep = ", " If Target.Count > 1 Then GoTo exitHandler 'checks validation type of target cell 'type 3 is a drop down list On Error Resume Next strType = Target.Validation.Type If Target.Column = dvCol3 And strType = 3 Then Application.EnableEvents = False newVal = Target.Value Application.Undo oldVal = Target.Value If oldVal = "" Or newVal = "" Then Target.Value = newVal Else Target.Value = oldVal _ & mySep& newVal End If End If exitHandler: Application.EnableEvents = True End Sub

B3) Change the Multi-Select Code

Did the multi select code work correctly, on the Single sheet?

If the multi-select code did NOT work correctly, you might need to make a small change to the macro code.

Column Number in Code

In the Multi Select code that you copied, there are two variables that you can change, if needed -- dvCol and mySep.

  • dvCol is defined as a long number, and set as 3
  • mySep is defined as a text string, and set as ", "

two variables in multi select code

1) Variable dvCol

The dvCol variable tells the macro which column has the data validation drop down that you want to set as multi-selection.

  • In my original code, dvCol is set as 3

If the drop down is in a different column in your workbook, change the dvCol number. For example, for column F, change dvCol to 6.

dvCol = 6

2) Variable mySep

The original code uses a comma and space character to separate the names

mySel = ", "

In your workbook, you could change the separator to something different, such as a semicolon and space

mySel = "; "

B4) More Changes to Code

Here are a few mores examples of how you can change the Multi Select Code

Instead of a single column, add more columns in the code. For example:

If Target.Column = 3 _
Or Target.Column = 5 _
Or Target.Column = 6 Then

Or, use a starting and ending column. For example:

  If Target.Column >= 3 And _
Target.Column <= 10 Then

Or, include a starting row as well. For example:

If Target.Column = 3 _
And Target.Row >= 4 Then

Delete Code Lines

Or, if you don't want to limit the code to a specific column, you could delete the two rows that are marked with a red dot. When those lines are removed, the code will run when any cell with a drop down list is selected.

Data Validation Multiple Select Code

Change Sheet and Range Names

In some code samples, the sheet names and named ranges are included. You will have to change these to match your sheet names and range names.

For example, shown below is a portion of the code from the LineBreakAddSort sheet. The sheet and range names are highlighted in yellow.

Also, this code is set up for a list in column 3.

i=ws.Cells(Rows.Count,3).End(xlUp).Row + 1

You would need to change that number, if your list is in a different column.

sheet names in Data Validation Multiple Select Code

C1) Allow Editing With Multi Select

With this technique, you can select multiple items from a drop down list, but if you try to edit the cell, you might see a data validation error alert, or find that the VBA code simply added your revised text, to the existing text -- probably not the result that you wanted!

problem editing multi select cell

C1.1) Edit Multiple Selection Drop Down List

In the sample file, on the SameCellEdit worksheet, there is an "Edit Entries" check box. Check that box, and you can edit the cell, without any problems.

To edit a cell with multiple items selected:

  • Add a check mark in the Edit Entries check box
  • Select the cell, and edit the entries, either in the cell, or in the formula bar
  • Press Enter, to complete the editing

Add a check mark in the Edit Entries check box

C1.2) Return to Multiple Selection

After you finish editing the cell(s), press Enter, to complete the editing. Then, remove the check mark from the Edit Entries check box.

remove the check mark from the Edit Entries check box

C1.3) Add an Editing Check Box

To add a check box on your worksheet, follow the steps below:

C1.3a) Add the Check Box

  • On the Excel Ribbon's Developer tab, click Insert, and then click the Check Box under Form Controls

Check Box under Form Controls

  • Click at the top of the worksheet, to add a check box

C1.3b) Change the Text

change check box text

  • Select the default text, and type "Edit Entries"

type new check box text

C1.3c) Create a Named Cell

  • Somewhere in the workbook, create a cell named "EditMode". In this example, the EditMode cell is on a worksheet named AdminNotes.

create a cell named EditMode

C1.3d) Format the Check Box

  • Right-click on the check box, and click Format Control

Right-click on the check box, and click Format Control

  • In the Format Control dialog box, go to the Control tab
  • In the Cell Link box, type, EditMode
  • Click the OK button, to close the dialog box.

In the Cell Link box, type, EditMode

C1.4) Revised Multiple Selection VBA Code

In the sample file, you can see the code that allows editing when the Edit Entries box is checked. In the screen shot shown below, the EditMode range is set as a variable (rngEdit), and the code looks at that cell's value.

  • If the value is False (no check mark), the multiple selection code runs.
  • If the value is True (check mark), the multiple selection code does not run.

code that allows editing when the Edit Entries box is checked

C2) Allow New Items in List - Add Sort

On the SameCellAddSort sheet in the sample file, there is an example where you can add new items to the drop down lists, but only in specific columns (C and D).

The new items are added to the Lists worksheet, and then the list is sorted A-Z.

new items are added to the Lists worksheet

C2.1) Video: Allow New Items

To see this example, and how the Excel VBA code works, watch this short video tutorial

Video Timeline

  • 0:00 Data Validation Drop Downs
  • 0:37 Add New Item to Names List
  • 1:15 See Excel VBA Code & Lists
  • 2:03 Step Through VBA Code
  • 4:33 Code Adds New Item to List

C3) No Duplicates in Cell

On the SameCellNoDups sheet, there is an example where you are not allowed to select the same item twice in any of the cell.

  • If the item is not currently in the cell, it is added to the active cell in column C, separated by a comma
  • If the item has been previously selected in the cell, that item is not added again.

On the SameCellNoDupsCol sheet, duplicate selections are allowed in cells in columns B and D, but no duplicates can be entered in the cells in column C.

no duplicate items in column C cells

C4) Remove Previous Selections From Cell

On the SameCellAddRemove worksheet, there is an example that lets you remove items if they been previously selected. For example, the cell contains four items -- "One, Two, Three, Four".

Remove Previous Selections From Cell

When you select Three again, that number is removed from the cell, instead of being added at the end of the cell.

Previous Selections Removed From Cell

C4.1) Video: Remove Previous Selections From Cell

This video shows how the multiple select and remove features work. You can also see the Excel VBA code, and the steps that it goes through, when you make a selection in the drop down list.

C5) AutoFilter With Multiple Selections

If you enter multiple items in a cell, you will see each unique combination of items in the AutoFilter drop downs. That can make it difficult to filter for a specific item, such as "Two".

AutoFilter With Multiple Selections

As a workaround, you can use one of the techniques shown below:

--13.1) Use the Search box to find items that contain specific text

--13.2) Use a Slicer to filter for specific text.

C5.1) Search Box - Contains

In Excel 2010 and later, type in the filter Search box, just above the list of filter options. The list is automatically filtered as you type, to show only the items that contain the text that has been entered in the Search box..

type in the filter Search box

This short video shows the steps for searching in the AutoFilter list.

C5.2) Filter with Slicer (Macro)

In this example, there are multiple weekday names selected in the WorkDays column. Above the table, click on a Slicer, to filter the WorkDays column for any rows that contain the selected weekday name.

In the sample file, code runs automatically, to allow multiple selection, and and to filter the WorkDays column.

You can get this sample file in the Download section, below, and there are notes in the Excel file, on how this technique is set up.

click the Slicer to filter the WorkDays column

Get the Excel Files ✅

  • Multi Select Basic: To follow along with the video, you can download the zipped sample file: Multi Select Basic . The zipped Excel file contains macros, so be sure to enable macros if you want to test the code
  • Multiple Selection Examples: To experiment with the multiple selection technique, you can download the zipped sample file: Select Multiple Items from Excel Data Validation List. If you copy the code into a different workbook, remember to check the code for sheet names, range names, row numbers and column numbers, and adjust those if necessary.
  • Filter With Slicer: To test the Filter with Slicer technique, you can download the zipped sample file: Filter Data in Multi-Select Cells. The zipped Excel file contains macros, so be sure to enable macros if you want to test the code.

Get Monthly Excel Tips!

Don't miss my monthly Excel newsletter! You'll get quick tips, article links, and a bit of fun. Add your email, and click Sign Up.

Next, when you get my reply, click the Confirm button. I add this step to protect you from spam!

More Multiple Item Articles

This is the main page for the data validation multiple selection technique. I have also written several blog articles, and you can join in the discussion in the comments there:

drop down list in excel with multiple selections

 

 


Last updated: October 2, 2026 12:57 PM