By default, you can only select one item in a data validation drop-down list in Excel. How can you make multiple selections in the drop-down list as below gif shown? The methods in this article can help you solve the problem.
Create drop down list with multiple selections with VBA code
1) Allow multiple selections in a drop-down list without duplicates
2) Allow multiple selections in a drop-down list without duplicates (delete existing items by selecting it again)
Easily create drop down list with multiple selections with an amazing tool
More tutorial for drop down list...
Create drop down list with multiple selections with VBA code
This section provides two VBA codes to help you make multiple selections in drop-down lists in a worksheet. The two VBA codes can achieve:
VBA code 1: Allow multiple selections in a drop-down list without duplicates
VBA code 2: Allow multiple selections in a drop-down list without duplicates (delete existing items by selecting it again)
You can apply one of the following VBA codes to make multiple selections in a drop-down list in a worksheet in Excel. Please do as follows.
1. Open the worksheet contains the data validation drop-down lists from which you want to make multiple selections. Right click the sheet tab and select View Code from the context menu.
2. In the Microsoft Visual Basic for Applications window, copy the below VBA code into the code window. See screenshot:
VBA code 1: Allow multiple selections in a drop-down list without duplicates
Private Sub Worksheet_Change(ByVal Target As Range) 'Updated by Extendoffice 2019/11/13 Dim xRng As Range Dim xValue1 As String Dim xValue2 As String If Target.Count > 1 Then Exit Sub On Error Resume Next Set xRng = Cells.SpecialCells(xlCellTypeAllValidation) If xRng Is Nothing Then Exit Sub Application.EnableEvents = False If Not Application.Intersect(Target, xRng) Is Nothing Then xValue2 = Target.Value Application.Undo xValue1 = Target.Value Target.Value = xValue2 If xValue1 <> "" Then If xValue2 <> "" Then If xValue1 = xValue2 Or _ InStr(1, xValue1, ", " & xValue2) Or _ InStr(1, xValue1, xValue2 & ",") Then Target.Value = xValue1 Else Target.Value = xValue1 & ", " & xValue2 End If End If End If End If Application.EnableEvents = TrueEnd Sub
3. Press the Alt + Q keys to close the Microsoft Visual Basic for Applications window.
Now you can select multiple items from the drop-down list in the current worksheet.
Supposing you have selected an item accidently and need to remove it without clearing the whole cell and starting over. The following VBA code 2 can do you a favor.
VBA code 2: Allow multiple selections in a drop-down list without duplicates (delete existing items by selecting it again)
Private Sub Worksheet_Change(ByVal Target As Range) 'Updated by Extendoffice 2023/01/11 'Updated by Ken Gardner 2022/07/11 Dim xRng As Range Dim xValue1 As String Dim xValue2 As String Dim semiColonCnt As Integer Dim xType As Integer If Target.Count > 1 Then Exit Sub On Error Resume Next xType = 0 xType = Target.Validation.Type If xType = 3 Then Application.ScreenUpdating = False Application.EnableEvents = False xValue2 = Target.Value Application.Undo xValue1 = Target.Value Target.Value = xValue2 If xValue1 <> "" Then If xValue2 <> "" Then If xValue1 = xValue2 Or xValue1 = xValue2 & ";" Or xValue1 = xValue2 & "; " Then ' leave the value if only one in list xValue1 = Replace(xValue1, "; ", "") xValue1 = Replace(xValue1, ";", "") Target.Value = xValue1 ElseIf InStr(1, xValue1, "; " & xValue2) Then xValue1 = Replace(xValue1, xValue2, "") ' removes existing value from the list on repeat selection Target.Value = xValue1 ElseIf InStr(1, xValue1, xValue2 & ";") Then xValue1 = Replace(xValue1, xValue2, "") Target.Value = xValue1 Else Target.Value = xValue1 & "; " & xValue2 End If Target.Value = Replace(Target.Value, ";;", ";") Target.Value = Replace(Target.Value, "; ;", ";") If Target.Value <> "" Then If Right(Target.Value, 2) = "; " Then Target.Value = Left(Target.Value, Len(Target.Value) - 2) End If End If If InStr(1, Target.Value, "; ") = 1 Then ' check for ; as first character and remove it Target.Value = Replace(Target.Value, "; ", "", 1, 1) End If If InStr(1, Target.Value, ";") = 1 Then Target.Value = Replace(Target.Value, ";", "", 1, 1) End If semiColonCnt = 0 For i = 1 To Len(Target.Value) If InStr(i, Target.Value, ";") Then semiColonCnt = semiColonCnt + 1 End If Next i If semiColonCnt = 1 Then ' remove ; if last character Target.Value = Replace(Target.Value, "; ", "") Target.Value = Replace(Target.Value, ";", "") End If End If End If Application.EnableEvents = True Application.ScreenUpdating = True End IfEnd Sub
Notes:
1). Duplicate values do not allow in the drop-down list.
2). The VBA code 2 above was provided by our enthusiastic user Ken Gardner on 2022/07/11.
3). Please save the workbook as an Excel Macro-Enabled Workbook in order to keep the code working in the future.
4). After adding the VBA code 2, you can remove an existing item by selecting it again in the drop-down list. See the gif below:
Easily create drop down list with multiple selections with an amazing tool
Here we highly recommend the Multi-select Drop-down List feature of Kutools for Excel for you. With this feature, you can easily select multiple items from the drop-down list in a specified range, current worksheet, current workbook or all opened workbooks as you need.
Before applying Kutools for Excel, please download and install it firstly.
1. Click Kutools > Drop-down List > Multi-select Drop-down List > Settings. See screenshot:
2. In the Multi-select Drop-down List Settings dialog box, please configure as follows.
- 2.1) Specify the applying scope in the Apply to section. In this case, I select Current worksheet from the Specified Scope drop-down list;
- 2.2) In the Text Direction section, select an text direction based on your needs;
- 2.3) In the Separator box, enter a delimiter which you will use to separate the multiple values;
- 2.4) Check the Do not add duplicates box in the Options section if you don’t want to make duplicates in drop-down list cells;
- 2.5) Click the OK button. See screenshot:
3. Please click Kutools > Drop-down List > Multi-select Drop-down List to enable the feature.
Now you can select multiple items from the drop-down list in current worksheet or any scope you have specified in step 2.
If you want to have a free trial (30-day) of this utility, please click to download it, and then go to apply the operation according above steps.
Related articles:
Autocomplete when typing in Excel drop down list
If you have a data validation drop down list with large values, you need to scroll down in the list just for finding the proper one, or type the whole word into the list box directly. If there is method for allowing to auto complete when typing the first letter in the drop down list, everything will become easier. This tutorial provides the method to solve the problem.
Create drop down list from another workbook in Excel
It is quite easy to create a data validation drop down list among worksheets within a workbook. But if the list data you need for the data validation locates in another workbook, what would you do? In this tutorial, you will learn how to create a drop fown list from another workbook in Excel in details.
Create a searchable drop down list in Excel
For a drop down list with numerous values, finding a proper one is not an easy work. Previously we have introduced a method of auto completing drop down list when enter the first letter into the drop down box. Besides the autocomplete function, you can also make the drop down list searchable for enhancing the working efficiency in finding proper values in the drop down list. For making drop down list searchable, try the method in this tutorial.
Auto populate other cells when selecting values in Excel drop down list
Let’s say you have created a drop down list based on the values in cell range B8:B14. When you selecting any value in the drop down list, you want the corresponding values in cell range C8:C14 be automatically populated in a selected cell. For solving the problem, the methods in this tutorial will do you a favor.
More tutorial for drop down list...
The Best Office Productivity Tools
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
- Reuse: Quickly insert complex formulas, chartsand anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
- Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
- Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
- Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
- Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
- Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
- Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
- Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
- More than 300 powerful features. Supports Office / Excel 2007-2021 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial. 60-day money back guarantee.
Read More... Free Download... Purchase...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
Read More... Free Download... Purchase...
FAQs
How to create dependent drop-down list in Excel with multiple selections? ›
- Select the cell where you want the first (main) drop down list.
- Go to Data –> Data Validation. ...
- In the data validation dialog box, within the settings tab, select List.
- In Source field, specify the range that contains the items that are to be shown in the first drop down list.
- Select a cell where you want to create the drop down list (cell C2 in this example).
- Go to Data –> Data Tools –> Data Validation.
- In the Data Validation dialogue box, within the Settings tab, select List as the Validation criteria.
Select Multiple Items From Drop Down List. Instead of limiting the drop down list to a single selection, you can use a bit of programming, combined with the data validation list, and allow multiple selections.
How do I show multiple selected values in Dropdownlist? ›In this function, we use DOM using the id of a drop-down button with multiple properties and assign it to true. And this “multipleFunc” is connected to a normal button, so when we click on this button to activate the “multipleFunc” function to select more than one option in the dropdown button.
How do I create a multi select dropdown? ›- Navigate to Administration > Data Management > Dropdown Lists.
- Click +CATEGORY. ...
- Enter the Category Name and Description: Category Name can contain the character length of 3 to 100.
- Select the Variant either Single Select or Multi Select for the respective dropdown list.
- Click ADD.
- Select one or more cells to validate.
- On the Data tab, in the Data Tools group, click Data Validation.
- On the Settings tab, in the Allow box, select List.
- In the Source box, type your list values, separated by commas. ...
- Make sure that the In-cell dropdown check box is selected.
Drop-down Menu: Dynamic Select. The drop-down menu is a clear method of showing a list of data, allowing users to pick their choice from the list. This field can be categorized into two types based on the choice of selection types offered.
How do I use multi select listbox in Excel? ›- On the worksheet, click on a cell that has a drop down list.
- The VBA listbox pops up automatically, and shows all the choices from the cell's drop down list.
- Add a check mark to one or more of the items in the list box.
- When you're finished selecting items, click the OK button.
...
Let us consider a test case in which we will automate the following scenarios:
- Invoke Google Chrome Browser.
- Select the option "Database Testing" from the drop-down menu.
- Close the browser.
A cascading drop-down list is a series of dependent DropDownList controls in which one DropDownList control depends on the parent or previous DropDownList controls. The items in the DropDownList control are populated based on an item that is selected by the user from another DropDownList control.
What are the 3 types of Data Validation in Excel? ›
Time - The user should enter a time. Text Length - It validates input based on the length of the data. Custom - It validates the user input using a custom formula.
How do you avoid duplicates using Data Validation in Excel? ›Or simply use the combination of Ctrl + Shift + End. It is important to select the 1st data cell first. Go to Excel "Data" tab and click on the Data Validation icon to open the dialog box. On the Settings tab, choose "Custom" from the Allow drop down list and enter =COUNTIF($D:$D,D2)=1 into the Formula box.
How do I return multiple matching values using multiple criteria in Excel? ›...
To apply the formula, we need to follow these steps:
- Select cell E3 and click on it.
- Insert the formula: =TEXTJOIN(",", TRUE, IF(B3:B13=F3, C3:C13, ""))
- Press Ctrl+Shift+Enter to enter the array function.
Now, in E1 select data validation and in the parameter dialog box select List with the Source as B1:B4. Check in-cell dropdown. Now, in cell E1, clicking the arrow gives you a selection from the four colors, select one. Now click the arrow again and you are presented with the remaining possible selections.
How do you multiselect a dynamically populated dropdown based on another dropdown value selection? ›It's simple: just add an onClick to call a function every time the options are checked (or unchecked), and then, loop the checkboxes looking for the cheked options, concatenating their texts and showing it at the main label of the select. Same thing is possible if you want to show the number of items selected.
How to select multiple options from dropdown without select class? ›- Method 1: By storing all the options in List and iterating through it.
- Method 2: By creating Custom Locator and without iterating the List.
- Method 3: By using JavaScriptExecutor class.
- Method 4: By using sendKeys method.
Hold the CTRL key and click the items in a list to choose them. Click all the items you want to select.
Can you have a drop down list in Excel with multiple selections? ›Go to Data –> Data Tools –> Data Validation. In the Data Validation dialogue box, within the settings tab, select 'List' as Validation Criteria. In Source field, select the cells which have the items that you want in the drop down. Click OK.
How do you generate all possible combinations of items from multiple lists Excel? ›- Click the Expand button in the column header. From the sub-menu: Select only the column with the data we wish to retain (i.e., in our example, uncheck the Temp column) ...
- The list of possible combinations now appears in the Power Query window.
A standard list box is a box containing a list of multiple items, with multiple items visible. A drop-down list is a list in which the selected item is always visible, and the others are visible on demand by clicking a drop-down button.
What is the difference between dropdown and multiple choice? ›
Multiple Choice Fields: A question with a group of answers choices that lets the user select one choice only. Dropdown Menus: A question with an answer fields that expands into a list of options that lets the user select one choice.
What is data toggle dropdown? ›Via data attributes or JavaScript, the dropdown plugin toggles hidden content (dropdown menus) by toggling the .show class on the parent list item. The data-toggle="dropdown" attribute is relied on for closing dropdown menus at an application level, so it's a good idea to always use it.
Can you have a drop-down list in Excel with multiple selections? ›Go to Data –> Data Tools –> Data Validation. In the Data Validation dialogue box, within the settings tab, select 'List' as Validation Criteria. In Source field, select the cells which have the items that you want in the drop down. Click OK.
How do I make multiple selections from a drop-down list in Excel without duplicates? ›- Select the column range you want to use in the table, the press Ctrl + C to copy it, and place it to another position by pressing Ctrl + V.
- Then keep selecting the list, click Data > Remove Duplicates.