Archive of Mr Excel Message Board
I built a form with checkboxes (yes/no per question) and I need it to do the following: if the checkbox 4 is checked, I want it to automatically check checkbox 13.
I wrote a simple subscript with if then (because I'm a beginner) but it doesn't seem to work. Can someone help me out?

Can I see some code that you wrote
also what do you want to happen and do you have an OK button on the form and do you want it to run after the OK button is pushed.
If you have an OK button then somethink like this
commandbutton1_click()
If checkbox4.value = true then
if checkbox13.value =true then
"Your code here"
End if
End if
unload userform1
end sub

Here is the code I had that didn't work:
Private Sub CheckBox4_Click(A4 As CheckBox)
If CheckBox4.Value = True Then
CheckBox13.Value = True
End If
End Sub
To answer your question, I do not have an OK button on the form. I just want the users to avoid contradictions by answering 2 questions that exclude each other. Actually, it would be amazing if instead of checking box13, it grayed it out so they wouldn't be allowed to use it ...
Thanks for the help!

try this code
steve w
Private Sub CheckBox4_Click()
If CheckBox4.Value = True Then
CheckBox13.Value = True
CheckBox13.Enabled = False
Else
CheckBox13.Enabled = True
CheckBox13.Value = False
End If
End Sub

