Check Box


Posted by Joe C on October 22, 2001 11:50 AM

I put a checkbox in a spread sheet.
How do I reference it in VBA to see if it is true or false.
Can I put a checkbox in a sheet, and use it in this manner?
I tried
If CheckBox15 = True Then
but it does not seem to be checking the value.

Posted by Jonathan on October 22, 2001 4:43 PM

Hmmm. Works for me if I reference it like this:

If Sheet1.CheckBox1.Value = True Then
MsgBox "True"
Else
MsgBox "False"
End If

Actually you can leave the .value part off

If Sheet1.CheckBox1 = True Then
MsgBox "True"
Else
MsgBox "False"
End If

because Value is the default property of the checkbox.

HTH



Posted by Joe C on October 23, 2001 8:03 AM

Sh#t forgot the Sheet

Sheet1. I was missing that.
Thanks