How To Create Multi Select Dropdown In Excel With Remove Option (Easy VBA Trick)

Publié le: 28 février 2025
sur la chaîne: Anser's Excel Academy
48,389
398

Fix Excel Dropdown Issues Easily (Multi-Select with Remove Option)

In this video, you’ll learn how to make dropdown lists in Excel where you can select more than one item and remove them too! We’ll use simple VBA code and apply it to many cells at once. Perfect for beginners or anyone stuck with dropdown problems in Excel. Please visit my website to get more information: https://excelwithanser.com/

Original VBA Code credit goes to @SoftTechTutorials89‬. I have modified the code to allow for these new changes discussed in the video.

🔔𝐃𝐨𝐧'𝐭 𝐟𝐨𝐫𝐠𝐞𝐭 𝐭𝐨 𝐬𝐮𝐛𝐬𝐜𝐫𝐢𝐛𝐞 𝐭𝐨 𝐦𝐲 𝐜𝐡𝐚𝐧𝐧𝐞𝐥 𝐟𝐨𝐫 𝐦𝐨𝐫𝐞 𝐮𝐩𝐝𝐚𝐭𝐞𝐬.
   / @excelwithanser  

🔗 Stay Connected With Me: https://excelwithanser.com/

🎬Suggested videos for you:

▶️    • How I Created A Power BI Dashboard From Ex...  
▶️    • How To Make All Combinations From Multiple...  
▶️    • How To Import Data from Multiple Excel Fil...  
▶️    • Fuzzy Matching in Power Query: Compare, Co...  
▶️    • How to Combine Excel Files from a Folder D...  


THE VBA CODE:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim oldVal As String
Dim newVal As String
Dim items As Variant
Dim i As Integer
Dim updatedVal As String
Dim alreadyExists As Boolean

' Disable events to prevent infinite loops
Application.EnableEvents = False

' Check if the changed cell is within E1:E101
If Not Intersect(Target, Me.Range("E1:E20")) Is Nothing Then
' Ensure the changed cell has data validation
If Target.Validation.Type = 3 Then ' 3 refers to List validation
' Capture new selection
newVal = Target.value
Application.Undo ' Undo to get the old value
oldVal = Target.value

' If the cell was empty before, just set the new value
If oldVal = "" Then
Target.value = newVal
Else
' Convert old values to an array
items = Split(oldVal, ", ")
updatedVal = ""
alreadyExists = False

' Check if the new selection is already in the list
For i = LBound(items) To UBound(items)
If Trim(items(i)) = Trim(newVal) Then
alreadyExists = True ' Item already exists (needs to be removed)
Else
' Rebuild the list without removing other items
If updatedVal = "" Then
updatedVal = items(i)
Else
updatedVal = updatedVal & ", " & items(i)
End If
End If
Next i

' If the item was already in the list, remove it (deselect)
If alreadyExists Then
Target.value = updatedVal
Else
' Otherwise, add it to the list
If updatedVal = "" Then
Target.value = newVal
Else
Target.value = updatedVal & ", " & newVal
End If
End If
End If
End If
End If

ExitHandler:
' Re-enable events
Application.EnableEvents = True
Exit Sub
End Sub
















How To Create Multi Select Dropdown In Excel With Remove Option, Easy VBA Trick, Multi Select Dropdown Excel VBA Tutorial, Apply Dropdown To Multiple Rows In Excel, Excel VBA Data Validation Dropdown, Excel Multi Select, Multi Select Dropdown, Dropdown List Excel, Excel VBA Guide, Excel Tips 2025, Data Validation Excel, Excel Dropdown Fix, Excel VBA, Excel Data List, Excel Dropdown, Dropdown Menu, Excel List

#excelvba #multiselectdropdown #exceldropdownlist #datavalidationexcel #excel2025 #dropdownfix #vbatutorial #exceltricks #excelforbeginners #removefromdropdown #excelautomation #excelguide #excelvba #multiselectdropdown #dropdownfix #ExcelTutorial #MultiSelectDropdown #ExcelVBA #DataValidation #ExcelTips #SpreadsheetSkills #DataManagement #ExcelHacks #Office365 #excelforbusiness


Sur cette page du site, vous pouvez voir la vidéo en ligne How To Create Multi Select Dropdown In Excel With Remove Option (Easy VBA Trick) durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Anser's Excel Academy 28 février 2025, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 48,389 fois et il a aimé 398 téléspectateurs. Bon visionnage!