Archive of Mr Excel Message Board


Back to Controls in Excel archive index
Back to archive home

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


Re: simple checkboxes

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


Re: simple checkboxes

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


This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our online store to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.