用VBA进行有效性互斥的设置
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim D As Object
Dim i
Dim m
Set D = CreateObject("Scripting.Dictionary")
For i = 1 To 5
D(i) = ""
Next i
For m = 1 To Cells(65536, 1).End(xlUp).Row
If D.exists(Cells(m, 1).Value) Then D.Remove Cells(m, 1).Value
Next m
If D.Count < 1 Then Exit Sub
With Target.Validation
.Delete
.Add 3, 1, 1, Join(D.keys, ",")
End With
End Sub