Comments on: How to make Excel drop down list with multiple selections

By default, Excel data validation only allows users to select one item from a predefined list of options. But fear not, as there is a solution. By using VBA, you can create drop-down lists with multiple selections. Continue reading

Comments page 10. Total comments: 705

  1. I am trying to create a shared document for work using the Multi-selection dropdown with item removal and it works great however it doesn't cross over to the online version (which all my colleagues would see).

    It still lets me select from the list, the most basic form of it works, but the mutli selection and item removal doesn't seem to be translating over.

    Any idea how I can fix this?

  2. Hi, thanks for the code. Selecting multiple options works smoothly, but if by mistake I select a wrong item in the list, how can I remove it? nothing seems todo the trick. thanks in advance

    1. Hi! To remove the wrong item from a cell, you can use the code: Multi-selection dropdown with item removal. Or you can manually correct the data in the cell because the dropdown list creates a text string. You can edit it in the formula bar.

    2. my bad, apologies, I used the wrong code snippet. all works perfectly

  3. Hello,
    This code works beautifully, until I upload my spreadsheet to onedrive so that I can share it with colleagues, it then loses the option to select multiple options from the drop down list and only allows you to choose one, Is there a way to change the VBA code for a share point excel spreadsheet, Or is there another way to add a multiple selection list for one that opens on chrome ? Any help would be appreciated

    1. Hi! Remember that VBA only works in the desktop version of Excel. VBA macros and functions do not work in Excel Online.

  4. Hello,

    This is all great information!! So far is working perfectly! I do have a question, Is there any code that could eliminate your selection from the drop down box in the next row? For example, If I have multiple people using the excel spreadsheet and we have 2 rows with employee names in the drop down list, 1 person picks 3 names from the list and the next person in the next row needs to see what names they cannot pick.

  5. Thank you very much for providing this code, it works just how it's suppost to! I used the dropdown with multiple selections in separate lines code and realized, that the code does not keep the entries in the order of the drop-down menu. For instance: If you select Apricot and then Bread crumps, it will show it in the right sequence.If you de-select Apricot, it correctly only shows Bread crumps. However if you then select Apricot again, the result will be displayed at Bread crumps, Apricot. Is there a way to keep the selections in the order of the drop-down?

    1. Hello! Since the drop-down list creates a text string in the cell, you need to write special VBA code to sort the words in the text string within the cell.

  6. I am having a problem getting the code to work that allows the multi select in a protected workbook. Any suggestions? I’m not getting a specific error, the multi select functionality still doesn’t work when the additional code is added and it is updated with my password. Thanks!

    1. Hi! Unfortunately, this information is not enough to understand your task. Carefully follow the recommendations from the article above. You can use the sample file. See the link at the end of the article. Or explain your problem in detail. What do you want to do and what code are you using.

  7. The drop down list with multi- selection is great.

    Is there any code that could eliminate your selection from the drop down box and repopulate it in the next cell over when it is clicked?

  8. Hello,

    Thanks so much for these codes. It works perfectly. Would it be possible to enhance the code to provide user with long description in the drop down list, but returns the short abbreviation in the worksheet? For example, when entering a state, user types in "A" and the drop down shows "Alaska, Alabama, Arizona, Arkansas". If user selects "Alaska", the worksheet would record "AL".

    Best Regards.

    1. Hi again,

      please ignore. I figured out how to accomplish what I needed. In the line "newValue = Destination.Value", I simply replaced it with "newValue = Left(Destination.Value, InStr(1, Destination.Value, "-") - 1)". Of course, the state list would have to be entered as "AK-Alaska"; "AL-Alabama", ... Drop down list would show "AL-Alabama", but when user selects it, worksheet will show "AL".

      Many many thanks for the codes.

  9. Hi
    Thanks for the code. It works perfectly and it saved a lot of our time.
    Just wondering if it is possible to have different text colour for each phrase in one cell.
    Let say in your example, whenever 'Milk' is selected, it shows with a red text colour and the rest item are shown black. Is this something possible?
    BTW, I already tried the cell rule but it will change the text colour for entire cell not one item.
    Many thanks

  10. First, thank you for sharing this code. I'm excited to see it in use with my current worksheet. However, I have a question first: where do we insert this code? You wrote, "insert the VBA code at the back end of the target worksheet" without details for what that means.

    1. Hi! Read the entire article. Instructions are provided below in this paragraph: Insert VBA code to allow multiple selections.

  11. Hi, thanks for our tutorial!
    May I know if I can filter those "multiple selections" data that we just created?

    1. Hi! The drop-down list with multiple selections creates a text string. To create a filter on a part of this text string, you can try using the advanced filter options as described in these instructions: Filter text data.

  12. I have just downloaded your file and I dont have any error. Your example is working perfectly on every tab without error.

    I just don't get why yours is perfect but then your code injected in ours won"t behave exactly the same way.

    PS : This should be the last post, apologies for multiple posts for the same topic.

  13. Hi,

    Forgot to mention the nature of the error. It is a data validation error. It behaves as if the multiple options selected could not match when any of the options defined in the drop down list. In a way, it is true if the validation compares the value of the cell built with multiple entries with a cell defining the drop down list. In this case, there can't be a match hence we get an error flag.

    Surprisingly, looking at your example, it seems you don't meet the same behaviour.

    Best regards,

  14. Hi,

    Thank you for this valuable multiselection piece of VBA. Unfortunately, I have the same issue with an error flag on each cell now. The multi selection is working and even with your code enabled, there is no error flag if you select one option only. The error only comes when you select at least 2 options from the drop down list.

    I can't appy BThompson's suggestion as I only have 1 table.

    Any other suggestion please?

    Best regards,

    PS : I guess the filtering on this column with multiple options selected will not allow filtering by one of these options only, right? Any suggestion to allow "smart" filtering once multiple options are entered in a single cell?

    1. Hi! You said earlier that the sample file you downloaded works without errors. So, the problem is in your file. Check what VBA codes are in your file. Maybe some other code is preventing the macro from working. You may have characters in your data that you also use as delimiters. We discussed this in the comments above. I can't check your file.
      The drop-down list creates a text string. To create a filter on a part of a text string, you can try using the advanced filter options as described in this guide: Filter text data.

  15. Hello, I used your script and it works. However, the macros won't run for excel online. Do you have any idea how to fix it?

    1. Hi! I already answered in the comments above that Excel Online does not work with VBA. Therefore, macros and user-defined functions do not work there.

  16. This is great! One issue, I am now getting a data validation error flag on every cell where I have selected multiple items from the list. The field type information is - Data type: List Restriction: Value must match one of the listed items. Blanks are ignored and are automatically valid.

    I tried unchecking the 'show error alert after invalid data is entered' box in data validation but the error flags are still appearing.

    1. I ran into the same error. Try spacing your tables apart at least one column. Otherwise, your individual tables will be treated as part of the larger, original table.

      1. I have the same data validation issue. It seems isolated to when your data is in a table instead of just a collection of columns

    2. Hi! Unfortunately, I don't see your data and the cause of your problem. Check if the dropdown list works without the code. Then carefully copy the code to your worksheet. Or use the example file linked at the end of the article.

  17. How can I make a dropdown of a specific cell range associated with a cell containing a specific text where the text can vary based on a dropdown? For example, there is a data sheet that contains a column titled Product that has 3 products; another column titled Module that has 19 options each of which is associated with a specific product; a third column with 85 Agents who in turn are associated with specific modules. I'm trying to make a dropdown that if I select "x" module, it will only list the agents associated with that module. By the same token, a dropdown that would only list the modules associated with a specific product.

  18. Alex, this is amazing! Thank you! Quick question: is there a way to make a multi-selection available to only one column in a worksheet and have other data validation be single selection? Thanks.

    1. Hi! Pay attention to the following paragraph of the article above: Multi-select dropdown for specific columns, rows, cells

  19. How can I adapt the 'Multi-selection dropdown with item removal' code you provided to make it work for 2 columns in the worksheet (column 11 & column 12) ONLY. They both have separate drop-down lists, I want people to be able to multi-select more than 1 thing from the drop down list but give them chance to remove things selected by mistake without having to delete and start again. When I added If Destination.Column 4 And Destination.Column 6 Then GoTo exitError after section specified it didn't work and errored at bit of code with LEFT and RIGHT in ikt

    1. Hi! If you need the code to work in columns 11 and 12, specify those column numbers in the code, not 4 and 6. All the necessary information is in the article above.

  20. Really useful information here. I would like to know if there is a way to put this code in an addin and enable all workbooks to have access to the code instead of copying the code to the worksheet. I know the code is workbook worksheet specific but how can you remove this limitation?

  21. This code works great, thank you for the time spent creating this! My one question, i used the Multi-Select version of your code and its tailored to one column, column 3 but i would like to sort the results alphabetically in each cell that has multiple items selected, Im guessing i need a sort command between the last two "End If" is this correct? Can you provide an example?

    Thanks again for the well crafted code.

  22. I am enabling this function for 2 cells in a protected worksheet. However, this function for multiple selection with removal is working only when it's unprotected. My code is pasted below, thank you so much!

    'https://www.ablebits.com/office-addins-blog/create-multi-select-dropdown-excel/
    Option Explicit
    'Multi-selection dropdown with item removal
    'https://www.ablebits.com/office-addins-blog/create-multi-select-dropdown-excel/
    Private Sub Worksheet_Change(ByVal Destination As Range)
    Dim rngDropdown As Range
    Dim oldValue As String
    Dim newValue As String
    Dim DelimiterType As String
    DelimiterType = vbCrLf
    Dim DelimiterCount As Integer
    Dim TargetType As Integer
    Dim i As Integer
    Dim arr() As String

    If Destination.Count > 1 Then Exit Sub
    On Error Resume Next

    Set rngDropdown = Cells.SpecialCells(xlCellTypeAllValidation)
    On Error GoTo exitError

    If rngDropdown Is Nothing Then GoTo exitError
    'define only the cells need to enable multiple selection
    If Destination.Address Range("Destination_Expiring_Coverage").Address And Destination.Address Range("Destination_Renewing_Coverage").Address Then GoTo exitError

    TargetType = 0
    TargetType = Destination.Validation.Type
    If TargetType = 3 Then ' is validation type is "list"
    Application.ScreenUpdating = False
    Application.EnableEvents = False
    newValue = Destination.Value
    Application.Undo
    oldValue = Destination.Value
    Destination.Value = newValue
    If oldValue "" Then
    If newValue "" Then
    If oldValue = newValue Or oldValue = newValue & Replace(DelimiterType, " ", "") Or oldValue = newValue & DelimiterType Then ' leave the value if there is only one in the list
    oldValue = Replace(oldValue, DelimiterType, "")
    oldValue = Replace(oldValue, Replace(DelimiterType, " ", ""), "")
    Destination.Value = oldValue
    ElseIf InStr(1, oldValue, DelimiterType & newValue) Or InStr(1, oldValue, " " & newValue & DelimiterType) Then
    arr = Split(oldValue, DelimiterType)
    If Not IsError(Application.Match(newValue, arr, 0)) = 0 Then
    Destination.Value = oldValue & DelimiterType & newValue
    Else:
    Destination.Value = ""
    For i = 0 To UBound(arr)
    If arr(i) newValue Then
    Destination.Value = Destination.Value & arr(i) & DelimiterType
    End If
    Next i
    Destination.Value = Left(Destination.Value, Len(Destination.Value) - Len(DelimiterType))
    End If
    ElseIf InStr(1, oldValue, newValue & Replace(DelimiterType, " ", "")) Then
    oldValue = Replace(oldValue, newValue, "")
    Destination.Value = oldValue
    Else
    Destination.Value = oldValue & DelimiterType & newValue
    End If
    Destination.Value = Replace(Destination.Value, Replace(DelimiterType, " ", "") & Replace(DelimiterType, " ", ""), Replace(DelimiterType, " ", "")) ' remove extra commas and spaces
    Destination.Value = Replace(Destination.Value, DelimiterType & Replace(DelimiterType, " ", ""), Replace(DelimiterType, " ", ""))
    If Destination.Value "" Then
    If Right(Destination.Value, 2) = DelimiterType Then ' remove delimiter at the end
    Destination.Value = Left(Destination.Value, Len(Destination.Value) - 2)
    End If
    End If
    If InStr(1, Destination.Value, DelimiterType) = 1 Then ' remove delimiter as first characters
    Destination.Value = Replace(Destination.Value, DelimiterType, "", 1, 1)
    End If
    If InStr(1, Destination.Value, Replace(DelimiterType, " ", "")) = 1 Then
    Destination.Value = Replace(Destination.Value, Replace(DelimiterType, " ", ""), "", 1, 1)
    End If
    DelimiterCount = 0
    For i = 1 To Len(Destination.Value)
    If InStr(i, Destination.Value, Replace(DelimiterType, " ", "")) Then
    DelimiterCount = DelimiterCount + 1
    End If
    Next i
    If DelimiterCount = 1 Then ' remove delimiter if last character
    Destination.Value = Replace(Destination.Value, DelimiterType, "")
    Destination.Value = Replace(Destination.Value, Replace(DelimiterType, " ", ""), "")
    End If
    End If
    End If
    Application.EnableEvents = True
    Application.ScreenUpdating = True
    End If

    exitError:
    Application.EnableEvents = True

    End Sub

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    ActiveSheet.UnProtect Password:=strPwd
    On Error GoTo exitError2

    If Target.Validation.Type = 3 Then
    Else
    ActiveSheet.Protect Password:=strPwd
    End If

    Done:
    Exit Sub

    exitError2:
    ActiveSheet.Protect Password:=strPwd
    End Sub

    1. If you don't have enough knowledge in VBA, just follow the instructions in the article above. There is no value assigned to the strPwd variable.

  23. I have two sheets in my workbook. One is for tracking inventory and the other contains all the various select lists for different columns of data in the inventory sheet. For example, categories, subjects, status, etc. I can match-up the single select columns and lists across the two sheets but, I'd like the "subject" column to allow multiple entries as explained here. How to I tell it which sheet & column in the List sheet contains the data I want to use in a specific column in the Inventory sheet?

    1. Hi! As described in the article above, you can specify a sheet, column, or individual cells in which the drop-down list can make multiple selections.

    2. Clarification, How do I tell it which column in the List sheet contains the data I want to select from and add to a specific column in the Inventory sheet.

  24. How do I combine the code for "VBA code to select multiple items in dropdown list" and "How to enable multi-selection functionality in protected sheet"

    Option Explicit
    Private Sub Worksheet_Change(ByVal Destination As Range)
    Dim DelimiterType As String
    Dim rngDropdown As Range
    Dim oldValue As String
    Dim newValue As String
    DelimiterType = ", "
    If Destination.Count > 1 Then Exit Sub

    On Error Resume Next
    Set rngDropdown = Cells.SpecialCells(xlCellTypeAllValidation)
    On Error GoTo exitError

    If rngDropdown Is Nothing Then GoTo exitError

    If Intersect(Destination, rngDropdown) Is Nothing Then
    'do nothing
    Else
    Application.EnableEvents = False
    newValue = Destination.Value
    Application.Undo
    oldValue = Destination.Value
    Destination.Value = newValue
    If oldValue = "" Then
    'do nothing
    Else
    If newValue = "" Then
    'do nothing
    Else
    Destination.Value = oldValue & DelimiterType & newValue
    ' add new value with delimiter
    End If
    End If
    End If

    exitError:
    Application.EnableEvents = True
    End Sub

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)

    End Sub

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    ActiveSheet.Unprotect password:="password"
    On Error GoTo exitError2

    If Target.Validation.Type = 3 Then
    Else
    ActiveSheet.Protect password:="password"
    End If

    Done:
    Exit Sub

    exitError2:
    ActiveSheet.Protect password:="password"
    End Sub

    1. Hi! You have declared Worksheet_SelectionChange procedure twice. This is incorrect in VBA. Delete the code:

      Private Sub Worksheet_SelectionChange(ByVal Target As Range)

      End Sub

      1. I used the code below after your suggestion to remove the piece you mentioned. It's still not working, it won't let me select the multiple values - I see it protecting the sheet after entering the code, but won't allow for multiple value selection. I'm wondering if my add in of the protection code is in the wrong place? would you be able to combine the 2 codes into one as it's supposed to run and I can copy and paste that into excel? I would be so greatful for the assistance.

        Option Explicit
        Private Sub Worksheet_Change(ByVal Destination As Range)
        Dim DelimiterType As String
        Dim rngDropdown As Range
        Dim oldValue As String
        Dim newValue As String
        DelimiterType = ", "
        If Destination.Count > 1 Then Exit Sub

        On Error Resume Next
        Set rngDropdown = Cells.SpecialCells(xlCellTypeAllValidation)
        On Error GoTo exitError

        If rngDropdown Is Nothing Then GoTo exitError

        If Intersect(Destination, rngDropdown) Is Nothing Then
        'do nothing
        Else
        Application.EnableEvents = False
        newValue = Destination.Value
        Application.Undo
        oldValue = Destination.Value
        Destination.Value = newValue
        If oldValue = "" Then
        'do nothing
        Else
        If newValue = "" Then
        'do nothing
        Else
        Destination.Value = oldValue & DelimiterType & newValue
        ' add new value with delimiter
        End If
        End If
        End If

        exitError:
        Application.EnableEvents = True
        End Sub

        Private Sub Worksheet_SelectionChange(ByVal Target As Range)
        ActiveSheet.Unprotect password:="password"
        On Error GoTo exitError2

        If Target.Validation.Type = 3 Then
        Else
        ActiveSheet.Protect password:="password"
        End If

        Done:
        Exit Sub

        exitError2:
        ActiveSheet.Protect password:="password"
        End Sub

        1. Hi! I have your code working without problems on a protected worksheet. Check on which worksheet this code is installed. Also try the recommendations on how to enable macros from the previous comment.

  25. Thank you for the tutorial. I have copied the code exactly, and the first time I used it it worked Perfectly, However, after saving it as a Macro enable excel sheet (as instructed) it no longer allows the multiple selection. I re-copied the code and it is still not working. Do you have any suggestions on how to correct this?

  26. I tried the code, but it does not work with me. I then downloaded your file, in fact multi selection does not work in your file as well. There is no error displayed, but it keeps showing one selection only. Do I have any issue on excel setting or else?
    Can anyone help?

  27. Hi Alexander,

    Wow, this is spectacular well written information. Thank you very much. I have a question about Multiple selections in specific cells. In you example you list just two cells, however what would be the process for several (5) cells.

    1. I have another question, I have a drop-down menu In which I have 3 variables like resistanxe, Voltage, current, in second column B1
      If one of the variables is selected I would like to have two variables pop upoutside this list under the $B$1 in $B$2, $B$3,
      Those $B$2, $B$3have their own variables like for $B$2 coffin Manson, Arhenius, but they should disappear if $B$1 ( current is selected). Or a other variable in $B$1. So if I have $B$1 on resistance= I will get two strings variables in $B$2, $B$3, if values are written in $C$2; $C$3; they should write it to the second sheet for a calculation. And stay there. They will be permanently saved somehow. I didn’t find a good solution for this. Please help or refer to a good explanation

      1. Hi! Your explanation is not quite clear. However, you can get the values in B2 and B3 depending on the value in B1 either by using the IF formula or by using VBA. These pieces of info are not enough to give you a formula.

  28. This is incredibly helpful! Wow thank you for sharing.

    I am trying to reference the various values selected in the drop down. Before, when it was just one value it was fairly straightforward. Now with multiple values I'm having trouble splitting them apart to be referenced. Any tips?

    1. Hi! The macro creates a text string of multiple values in a cell. You cannot reference part of the text string, only the entire cell.

  29. This tutorial was immensely helpful however, I am having an issue with 365 with the protected sheet code. Prior to protecting the sheet, the VBA code allows multi select in column 16 & 23 (without the additional protect code). Once the sheet is protected with these columns unlocked, I can only single select. I unprotected the sheet, added the additional VBA for protecting the sheet (edited the password), protected the sheet again, and have the same result- the sheet no longer allows multiselect once the protection is initiated.

    I read a previous message from a user who had the same issue but did not see a resolution. This is the code in my sheet- is there something I should be adding or an additional step I am missing? Thank you.

    Option Explicit
    Private Sub Worksheet_Change(ByVal Destination As Range)
    Dim DelimiterType As String
    Dim rngDropdown As Range
    Dim oldValue As String
    Dim newValue As String
    DelimiterType = ", "
    If Destination.Count > 1 Then Exit Sub

    On Error Resume Next
    Set rngDropdown = Cells.SpecialCells(xlCellTypeAllValidation)
    On Error GoTo exitError

    If rngDropdown Is Nothing Then GoTo exitError
    If Destination.Column 16 And Destination.Column 23 Then GoTo exitError

    If Intersect(Destination, rngDropdown) Is Nothing Then
    'do nothing
    Else
    Application.EnableEvents = False
    newValue = Destination.Value
    Application.Undo
    oldValue = Destination.Value
    Destination.Value = newValue
    If oldValue = "" Then
    'do nothing
    Else
    If newValue = "" Then
    'do nothing
    Else
    Destination.Value = oldValue & DelimiterType & newValue
    ' add new value with delimiter
    End If
    End If
    End If

    exitError:
    Application.EnableEvents = True
    End Sub

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    ActiveSheet.Unprotect password:="password"
    On Error GoTo exitError2

    If Target.Validation.Type = 3 Then
    Else
    ActiveSheet.Protect password:="password"
    End If

    Done:
    Exit Sub

    exitError2:
    ActiveSheet.Protect password:="password"
    End Sub

    1. Hi! In your code, instead of
      If Destination.Column 16 And Destination.Column 23 Then GoTo exitError
      must be written down
      If Destination.Column <>16 And Destination.Column <>23 Then GoTo exitError
      In this case, everything works for me.
      Before installing the code, you can try to remove the protection from the worksheet. It will be automatically enabled with this code.

    2. I see the sheet unprotecting and protecting itself any time I use the dropdown, but multiselect is no longer possible.

  30. Hello, everything works great for me until I attempt to add the code for a protected sheet. I am inputting my password, but I am getting an error for an ambiguous name. I believe it is related to how the code is formatted. Any help would be appreciated!

    1. To expand, when I remove the previous instance of the "worksheet_Selectionchange" I no longer get the error, but I cannot make multiple selections within my worksheet.

      1. Hi! Your description of the problem is not very clear. I can assume that you are adding two Worksheet_SelectionChange codes to the sheet. There should be only one code with this name. To work on a protected sheet, make changes in the code as described in the article above.

        1. Once my protected sheet code is added below the original code. I do not get any errors on a protected sheet, but the sheet works as if there has been no VBA code at all. In other words, when I attempt to add multiple selections, it only displays the most recent selection that has been chosen. I hope this helps to clear up the previous comment.

          1. Hi! Unfortunately, I can't see your workbook. Worksheet_Change and Worksheet_SelectionChange code must be added to the protected worksheet. All this is described in detail in the article above.

            1. Attached below is how I have the code structured. I hope this helps! I appreciate the quick responses!

              Option Explicit
              Private Sub Worksheet_Change(ByVal Destination As Range)
              Dim rngDropdown As Range
              Dim oldValue As String
              Dim newValue As String
              Dim DelimiterType As String
              DelimiterType = ", "

              If Destination.Count > 1 Then Exit Sub

              On Error Resume Next
              Set rngDropdown = Cells.SpecialCells(xlCellTypeAllValidation)
              On Error GoTo exitError

              If rngDropdown Is Nothing Then GoTo exitError

              If Intersect(Destination, rngDropdown) Is Nothing Then
              'do nothing
              Else
              Application.EnableEvents = False
              newValue = Destination.Value
              Application.Undo
              oldValue = Destination.Value
              Destination.Value = newValue
              If oldValue "" Then
              If newValue "" Then
              If oldValue = newValue Or _
              InStr(1, oldValue, DelimiterType & newValue) Or _
              InStr(1, oldValue, newValue & Replace(DelimiterType, " ", "")) Then
              Destination.Value = oldValue
              Else
              Destination.Value = oldValue & DelimiterType & newValue
              End If
              End If
              End If
              End If

              exitError:
              Application.EnableEvents = True
              End Sub

              Private Sub Worksheet_SelectionChange(ByVal Target As Range)
              ActiveSheet.Unprotect Password:="password"
              On Error GoTo exitError2

              If Target.Validation.Type = 3 Then
              Else
              ActiveSheet.Protect Password:="password"
              End If

              Done:
              Exit Sub

              exitError2:
              ActiveSheet.Protect Password:="password"
              End Sub

              1. I believe that error in the code is from copying and pasting the VBA code to this comment section. I confirmed that my code in excel is identical to the code in the above post. When the sheet is unprotected, the code works perfectly, but when the sheet is protected it only allows one item from the drop down to be added to each cell.

              2. I do not believe that the sample file includes the code for protected sheets. When adding the protected sheet code, I must delete the other mention of "worksheet_selectionchange" or I receive an ambiguous name error. The code above contains both the original code and protected sheet code, but it is obvious that it is inserted incorrectly as you have mentioned in the above comment. How should the protected sheet code be added to the original code?

              3. You have correctly written how the code should be inserted. But you changed the macro code. Pay attention to
                Destination.Value = newValue
                If oldValue "" Then
                If newValue "" Then
                If oldValue = newValue Or _
                Copy the code carefully.

              4. This code does not match the code suggested in the article and in the sample file linked at the end of the article.

          2. I am currently having the same issue. Once the sheet is protected, the multiselect is not available.

  31. This tutorial was immensely helpful; I created a drop-box list and am able to select multiple choices. When I copied the Excel Worksheet to the next Sheet, this function doesn't copy over, even when I attempt to highlight the cells and reinsert the code. Is there an effective way to copy this functionality?

    1. Hi! As noted in the article above, the code is specific to the worksheet, therefore be sure to add it to each worksheet where you want to allow multiple selections in the drop-down lists. Also, a worksheet can only have one VBA code from the three offered to you.

      1. Hi there -- I'm so grateful for this code and your straightforward instructions! I'm having a small issue. The code works perfectly on my first worksheet but not on my second worksheet. I've copied and pasted the same code from my first to my second but I don't get the multi-selection functionality. Is there something in the code that needs to change from one worksheet to the next? These are 2 sheets in the same Excel file (workbook). Much appreciated!

        1. Hi! When inserting the code into the second sheet, you do not need to change anything in the code. If multiple selection does not work, then the code is inserted incorrectly.

      2. Yes, I saw that information and I have ensured to use only one type of VBA code, and confirmed that it is listed under each sheet tab in the Excel Worksheet, and it still only works for the first entry. Any type of troubleshooting may I perform to confirm if there is an error in the process of what I did?

        1. Hi! If you copy entire worksheet, the macro code will be copied along with the data and will work. If you copy the data to a new blank worksheet, you need to set the code on that new worksheet as described in the article above.

  32. Hi, for some reason I cannot get the multiple-selection options to work (even when I download the example docs that you have linked). Is there some setting in Excel that would prevent this option from working? Or is there a specific key that needs to also be pressed for multiple selections when you are in the dropdown (I tried doing control, that did not work).

  33. Is there a way to share the file with others that has multiple selection so that they can edit the sheet?

    1. Hi! There are two ways to share a macro in Excel - you can either send the workbook with macros enabled or the file containing the macro code. The recipient can then open the workbook or import the code file to utilize the macro. However, it is important to note that this approach may not be successful if the recipient has varying security settings or Excel versions.

  34. Hello! Thank you for this info. I have a formula that attributes a monetary value to each selection of my drop down menu. Is there a way I can keep these value associations even with multiple selections? For example, If you choose "Party package A" from the drop down menu in Column F, then it will add $200 in column G. However if a person chose "Party Package A" along with "Balloon Garland", I'd like column G to total both the values of "Party package A" and "Balloon Garland"

    1. Hi! This depends on the formula you use in column G. The multiple selection macro creates a text string in column F of all the values you selected in the drop-down list.

  35. Now I got the problem that my other Formulars not work. How can I fix that I need them.

    1. The multiple selections macro only works in cells that have a drop-down list. It cannot affect your formulas.

  36. Only wanted to say thank you Alex for sharing with the rest of the world. This tutorial was extensive and included all possible variations for the same problem.

  37. Hi Alexander
    Thanks for your comprehensive useful post. Is there any way to allow multi-select from a dropdown list on excel online? For example, if I wanted to select more than one employee for a project.

    Thanks in advance!

    1. Hi! Excel Online does not support VBA. Therefore, no macros or custom functions work there. We have already written about it in the comments above.

  38. Thanks so much for this - I used this to put together a spreadsheet for my boss. I noticed one issue - if I try to delete one item from my cells that have the multiple selection options, it will just copy all the options again. I have to delete all the contents of the cell if I make one mistake. I wonder if there is a way around that.

    1. Hi! Your explanation of the problem is not quite clear. Multi-selection dropdown with item removal removes only one item from a cell.

  39. I have copied the code exactly as posted with no success.

    I then downloaded and opened the example document and enabled macros, even that file doesnt do it. Is there something I am missing or maybe a further excel setting that is disabling macros?

  40. This was super helpful and instructed me how to do exactly what I wanted. However, I am now running into a new issue. I want to count the number of unique occurrences for all selections made from the multi-selection list. Whenever I use a count function, it does not count any occurrences in cells that have multiple selections. Is there a way that I can make it count all occurrences, whether it be a singular selection or part of a multi-selection cell?

    1. Hi! A multiple choice drop-down list creates a text string in the cell that consists of all the values that have been selected. To determine if text strings partially match, use these instructions: How to find substring in Excel. To count all occurrences, try a formula:

      =SUMPRODUCT(--ISNUMBER(SEARCH("zzzz",A1:A100)))

      1. Hi. I have successfully applied your methods in a worksheet, it is really clear and helpful, thank you very much.

        I noticed when I copied the answer to this question, Excel initially gave an error message, which I could resolve after changing the "," to an ";" (as in
        =SUMPRODUCT(--ISNUMBER(SEARCH("zzzz";A1:A100))).

  41. thank you for this wonderful lessons. however, i was able to create a dropdown list but could not enable multiple selections. i copied and paste the VBA code but i keep getting error . saying compile error invalid outside procedure.
    i dont know what to do.

    1. Hi! You have inserted the code incorrectly. You can use the sample file linked at the end of this article.

  42. Hi Alex,
    When I input the code from the "How to enable multi-selection functionality in protected sheet" section, I get the error message: Ambiguous name detected: Worksheet_SelectionChange." Any ideas on how to fix this?

  43. Love this and your thorough steps! Can this be used on a call that uses "offset" data validation? I've copied and pasted the code and it doesn't seem to still work. Wondering if that could be the problem?

      1. I have a drop down list created that offers up options based on how some previous cells are filled out. I input the VBA code in the worksheet where the drop down list is but it doesn't work. So I was wondering if it was because that cell and the drop down list has an offset formula in that cell.

  44. Nice in theory; however, I feel like there must be some details missing in your explanation, as I can't even get past the first step. I even tried replicating your exact example on a new spreadsheet (created shorter Table/list) and typing literally what you had down to brackets/no spaces/double quotes/square brackets/etc. (=INDIRECT("Table1[Items]") And I got an error message "The source evaluates to an error, do you want to continue"? Generally, I am highlighting/selecting a column or series of rows for the 'Source' field. Were the "Table1[Items]" just a placeholder for highlighting/selecting that actual options? I tried that too but always get the same error message.

  45. Hi Alexander,

    This page is amazing! Thank you so much!

    I'm trying to make it so that in certain columns, the options selected are separated by a comma, while in certain columns the options are separated by line breaks. However, when I try to run it, I receive an error message saying: Ambiguous name detected.

    1. I figured out if you do an "If Destination.Column = 4 Then / DelimiterType = "/" ...lines copied from section of website you want... End If" You can define a new delimiter for each column. You have to do it individually though. I couldn't group multiple columns into one if loop.

      1. Hi! You can set a different type of separator for a column. Here is an example of how you can set different separators for columns D and F.

        If Destination.Column = 4 Then
        DelimiterType = "; "
        End If
        If Destination.Column = 6 Then
        DelimiterType = " - "
        End If

  46. Great article. I only have one comment for possible refinement of instructions.

    Your example has the look up and the data on the same sheet. I often put look ups on a separate sheet.

    You instructions on where to put the VS code should say "Select the sheet where you'll be selecting from your look up". As it's worded, it's initially unclear whether to paste the code into the sheet with the look up or the data entry.

    1. Hi! The article notes that the code is worksheet specific, so be sure to add it to every worksheet where you want to allow multiple selections in dropdowns.

  47. Can the VBA scripts somehow we specified in module within a workbook rather than within specific worksheets of the workbook?

  48. Alexandr, you are the best! Spasibo :)

  49. Hi, Alexander. Your material is super! Just one question, a bit more complex :)
    I've created an Excel table with multiselection dropdown in a specific column. Based on this table, I've created a pivot table with several slicers, one of these slicers refers to the column D with multiselection dropdown.
    When in a certain cell in the column D several options are selected, but in another cell only one of these options is selected, in my slicer I see different options for filtering. For example: "X", "Y", but also "X,Y,Z". Is it possible to create a slicer that shows unique options only but allow filter them in all cells in column D regardless if in the same cell other options are selected together with the one I want to filter?
    How this could be done?
    Thanks in advance, Natalia

  50. This was super useful! One thing i noticed about using the VBA for multiple selections is that is removes the ability to start typing the item name when searching for a dropdown item. I am working with a very long dropdown list, so this functionality really comes in handy. Is there any way to have the ability added back into the sheet?

Post a comment



Thank you for your comment!
When posting a question, please be very clear and concise. This will help us provide a quick and relevant solution to
your query. We cannot guarantee that we will answer every question, but we'll do our best :)