Validating checkboxes
Thanks! Works great.
"JNW" wrote:
See change below.
If CheckBox1.Value = False _
And CheckBox2.Value = False _
And CheckBox3.Value = False _
And CheckBox36.Value = False _
And CheckBox38.Value = False Then
MsgBox "Please check reason for request!"
Range("A11").Select
Exit sub '<<<<<Add this
End If
--
JNW
"Tammy H" wrote:
Hi All,
I have an Excel sheet that has several checkboxes. I also have a command
button that when clicked the form is emailed. When the user clicks the
cammand button I need to verify that at least one checkbox in each category
is checked before the form is emailed. I tried something like:
If CheckBox1.Value = False And CheckBox2.Value = False And CheckBox3.Value =
False And CheckBox36.Value = False And CheckBox38.Value = False Then
MsgBox "Please check reason for request!"
Range("A11").Select
End If
I receive the msgbox, but when I click ok, the form is emailed even though
there isn't any checkboxes checked. I think I need code after the msgbox
line but I am not sure how to do this. Can someone help me?
|