Good Morning Everyone,
I've set up a drop down window that shows a list of 4 items that the user can select from. The list is setup through Data Validation. I want to limit the total number of selections a user can make from this list to 4. I'm not concerned with the combinations selected. I just want to limit the number of items they select to four items. The code I have for this list is:
[vba]Set rngDV = Cells.SpecialCells(xlCellTypeAllValidation)
On Error GoTo exitHandler
If rngDV Is Nothing Then GoTo exitHandler
If Intersect(Target, rngDV) Is Nothing Then
'do nothing
Else
If Target.Value = "" Then GoTo exitHandler
Application.EnableEvents = False
Select Case Target.Column
Case 3, 7, 12, 16, 17, 20
If Target.Offset(0, 2).Value = "" Then
lRow = Target.Row
Else
lRow = Cells(Rows.Count, lCol + 2).End(xlUp).Row + 1
End If
Cells(lRow, lCol + 2).Value = Target.Value
End Select
End If[/vba]
I appreciate your help.
Thank you.