I have four checkboxes on an excel sheet (from control toolbox) I want to make it so that a minimum of 3 boxes are checked at any given time. For example I have North South East and West. N, S, E, are all true and W is false, when I click W I want N to become false. This is what i tried and it works to a point but it becomes a continuous loop and then i have to press esc to end the code.
Private Sub CheckBox1_Click()
'North
CheckBox2.Value = Not CheckBox1.Value
CheckBox3.Value = Not CheckBox1.Value
CheckBox4.Value = Not CheckBox1.Value
End Sub
Private Sub CheckBox2_Click()
'South
CheckBox3.Value = Not CheckBox2.Value
CheckBox4.Value = Not CheckBox2.Value
CheckBox1.Value = Not CheckBox2.Value
End Sub
Private Sub CheckBox3_Click()
'East
CheckBox4.Value = Not CheckBox3.Value
CheckBox1.Value = Not CheckBox3.Value
CheckBox2.Value = Not CheckBox3.Value
End Sub
Private Sub CheckBox4_Click()
'West
CheckBox1.Value = Not CheckBox4.Value
CheckBox2.Value = Not CheckBox4.Value
CheckBox3.Value = Not CheckBox4.Value
End Sub
What am i doing wrong?
Bookmarks