simple checkboxes


Posted by Gerhard on October 31, 2001 4:54 AM

Hi,

I can't get the following (very simple) code working.
I have an empty sheet with only 1 checkbox and the
following macro.
The error code says "Object Required". This is strange
since there is a checkbox (with number 1...)

Solutions???

Private Sub test()
If CheckBox1.Value = True Then
Cells(1, 1) = "True"
Else
Cells(1, 1) = "False"
End If

End Sub

Posted by Barrie Davidson on October 31, 2001 7:09 AM

Try
Private Sub test()
If ActiveSheet.CheckBox1.Value = True Then
Cells(1, 1) = "True"
Else
Cells(1, 1) = "False"
End If

End Sub


I think it will work for you.

BarrieBarrie Davidson



Posted by Gerhard on October 31, 2001 7:31 AM

Unfortunately It did not work. Now the error code is:
Object doesn't support this property or method'..
I've worked my way around this problem but are still
interested how to make it work in this simple case...

Gerhard