I found this code after searching for some VBA that would could create a drop-down selection box that would allow you to select up to THREE different selections (selecting multiple items from the list.)
I found this code that does exactly that:
examples of the code in use:
I think I understand how its working in order to do this, but because the code operates from a worksheet (including data validation from a range of cells on a worksheet), I cant see how I could modify this to possibly work on a userform drop-down selection list like I have on a userform... (or if something like this is even possible(?) )
example current userform drop down box:
I found this code that does exactly that:
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
'
Dim Oldvalue As String
Dim Newvalue As String
'
On Error GoTo Exitsub
If Target.Address = "$C$2" Then
If Target.SpecialCells(xlCellTypeAllValidation) Is Nothing Then
GoTo Exitsub
Else: If Target.Value = "" Then GoTo Exitsub Else
Application.EnableEvents = False
Newvalue = Target.Value
Application.Undo
Oldvalue = Target.Value
If Oldvalue = "" Then
Target.Value = Newvalue
Else
Target.Value = Oldvalue & ", " & Newvalue
End If
End If
End If
Application.EnableEvents = True
Exitsub:
Application.EnableEvents = True
End Sub
examples of the code in use:
I think I understand how its working in order to do this, but because the code operates from a worksheet (including data validation from a range of cells on a worksheet), I cant see how I could modify this to possibly work on a userform drop-down selection list like I have on a userform... (or if something like this is even possible(?) )
example current userform drop down box: