Interesting Problem.
Lets start with Multiple Selection Validation for Column C. This is possible using a simple Macro.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Oldvalue As String
Dim Newvalue As String
On Error GoTo Exitsub
If Target.Address <> "$A$1" Or Target.SpecialCells(xlCellTypeAllValidation) Is Nothing Or Target.Value = "" Then GoTo Exitsub
Application.EnableEvents = False
N = Target.Value
Application.Undo
If Target.Value = N Then Target.Value = "": GoTo Exitsub
If Target.Value <> "" Then O = Target.Value & ", "
If InStr(O, N & ", ") = 0 Then
T = O & N & ", "
Else:
T = Replace(O, N & ", ", "")
End If
T = Left(T, Len(T) - 2)
Target.Value = T
Exitsub:
Application.EnableEvents = True
End Sub
Ok I have modified that macro for your requirement.
Modifying A3 0r A8 will change the Data Validation in C3 and C8.
You can then make multiple selections in C3 and C8
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("A3:A8")) Is Nothing Then
Ans = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10"
DataT = Left(Ans, InStr(Ans, Target.Value) + Len(Target.Value) - 1)
With Cells(Target.Row, 3).Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:=DataT
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End If
If Not Intersect(Target, Range("C3:C8")) Is Nothing Then
Application.EnableEvents = False
N = Target.Value
Application.Undo
If Target.Value <> "" Then O = Target.Value & ", "
If InStr(O, N & ", ") = 0 Then
T = O & N & ", "
Else:
T = Replace(O, N & ", ", "")
End If
T = Left(T, Len(T) - 2)
Target.Value = T
Exitsub:
Application.EnableEvents = True
End If
End Sub
Bookmarks