I have 3 check boxes. no1 is the main checkbox. when it is checked no2 and no3 is enabled and when no1 is unchecked, no2 and no3 is disabled. when no2 is checked, no3 is disabled, and same for no3. on below code, everything is working nearly perfect, unless if the no3 is checked and then no1 is unchecked, no2 is enabled. normally it should be disabled due to no1 is unchecked.
Private Sub CheckBox1_Click()
Application.EnableEvents = False
If CheckBox1.Value = True Then
CheckBox2.Enabled = True
CheckBox3.Enabled = True
Else
CheckBox2.Enabled = False
CheckBox2.Value = False
CheckBox3.Enabled = False
CheckBox3.Value = False
End If
Application.EnableEvents = True
End Sub
Private Sub CheckBox2_Click()
Application.EnableEvents = False
If CheckBox2.Value = True Then
Sheets("Deep Storage Box").Visible = True
CheckBox3.Enabled = False
CheckBox3.Value = False
Else
Sheets("Deep Storage Box").Visible = False
CheckBox3.Enabled = True
End If
Application.EnableEvents = True
End Sub
Private Sub CheckBox3_Click()
Application.EnableEvents = False
If CheckBox3.Value = True Then
Sheets("Deep Storage Hanging").Visible = True
CheckBox2.Enabled = False
CheckBox2.Value = False
Else
Sheets("Deep Storage Hanging").Visible = False
CheckBox2.Enabled = True
End If
Application.EnableEvents = True
End Sub
I think when I unchecked the no1, "Private Sub CheckBox3_Click()" after "Else" section is trggering.