Now you need to place this code in a module in VB Editor (as shown below in the ‘Where to put the VBA code’ section’). Target.Value = Oldvalue & ", " & Newvalue If Target.SpecialCells(xlCellTypeAllValidation) Is Nothing ThenĮlse: If Target.Value = "" Then GoTo Exitsub Else ' To make mutliple selections in a Drop Down List in Excel
VBA Code to allow Multiple Selections in a Drop-down List (with repetition)īelow is the Excel VBA code that will enable us to select more than one item from the drop-down list (allowing repetitions in selection): Private Sub Worksheet_Change(ByVal Target As Range)
The next two sections of this tutorial will give you the VBA code to allow multiple selections in the drop-down list (with and without repetition). To enable this drop-down to allow us to make multiple selections, we need to add the VBA code in the back end. Now, cell C2 has a drop-down list which shows the items names in A2:A6.Īs of now, we have a drop-down list where you can select one item at a time (as shown below).