I want to disable a checkbox when another checkbox is in excel
I want to check a box and check the box associated with it in Excel.
If you clear this check box, select the Disabled check box.
I tried so many things but couldn't find a solution. Can I do this without a script?
I have 76 checkboxes to work with. So is this possible without a script? TIA
+5
source to share
5 answers
If you want the code to check and disable clicking on the second field then use the below code. If you uncheck the initial box, it will also enable and uncheck the second.
Private Sub CheckBox1_Click()
If CheckBox1.Value = True Then
CheckBox2.Value = True
CheckBox2.Enabled = False
Else
CheckBox2.Value = False
CheckBox2.Enabled = True
End If
End Sub
+1
source to share
Option Compare Database
Private Sub Ck1_Click()
If Ck1 = True Then
Ck2.Enabled = False
Ck3.Enabled = False
Else
Ck2.Enabled = True
Ck3.Enabled = True
End If
End Sub
Private Sub Ck2_Click()
If Ck2 = True Then
Ck1.Enabled = False
Ck3.Enabled = False
Else
Ck1.Enabled = True
Ck3.Enabled = True
End If
End Sub
Private Sub Ck3_Click()
If Ck3 = True Then
Ck1.Enabled = False
Ck2.Enabled = False
Else
Ck1.Enabled = True
Ck2.Enabled = True
End If
End Sub
0
source to share