Excel Drop Down List Multiple Selection

Опубликовано: 02 Февраль 2021
на канале: SoftTech Tutorials
49,183
134

Excel Drop Down List Multiple Selection

https://softtechtutorials.com/microso...

0:00 Intro
0:26 Inserting Excel Drop Down List
1:06 Opening VBA
1:40 VBA Code Multiple Selection
2:24 Initializing variables
2:41 Checking for changes in the drop down lists
3:22 Multiple selected items

Multiple Selection Code:

Private Sub Worksheet_Change(ByVal Target As Range)

' Initializing variables
Dim oldVal As String
Dim newVal As String

' Checking for changes in the drop down lists

Application.EnableEvents = True

If Target.Address = "$G$2" Or Target.Address = "$G$3" Then

If Target.SpecialCells(xlCellTypeAllValidation) Is Nothing Then
Exit Sub
' Adding the multiple selected items to the list
Else
If Target.Value = "" Then
Exit Sub

Else
Application.EnableEvents = False
newVal = Target.Value
Application.Undo
oldVal = Target.Value
If oldVal = "" Then
Target.Value = newVal
Else
If InStr(oldVal, newVal) = 0 Then
Target.Value = oldVal & ", " & newVal '& vbNewLine &
Else
Target.Value = oldVal
End If
End If
End If
End If
End If

Application.EnableEvents = True

End Sub

In this tutorial, I will explain how to create a drop down list that is dependent on the answer to another drop down list. We will do this without using any complex formulas.

Above, you can find the code that is used in this video. Feel free to use and adjust it as suits best for you.

This concludes our Excel drop down list multiple selection tutorial.

#Excel #Tutorials #HowTo


На этой странице сайта вы можете посмотреть видео онлайн Excel Drop Down List Multiple Selection длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь SoftTech Tutorials 02 Февраль 2021, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 49,183 раз и оно понравилось 134 зрителям. Приятного просмотра!