Archive of Mr Excel Message Board

Back to Controls in Excel archive index
Back to archive home

"Tying" checkboxes to cells
Posted by Rick Buchanan on September 14, 2000 6:48 PM
My problem is this:
I have a row that I only need visible a couple of months out of the year. When visible, each cell in the row has a checkbox in it.
When I try to "Hide" the row, the row disappears but the checkboxes don't. It is very frustrating. I would like the checkboxes to "Hide" with the row. Currently I am having to delete and recreate the rows (and the checkboxes) everytime I need them.
Let me know what you think,
Rick

Re: "Tying" checkboxes to cells
Posted by Rick on September 15, 0100 10:09 AM
Yes... I would very much like the code. I am some-what familiar with VBA but I haven't figured out how to do this.

Re: "Tying" checkboxes to cells
Posted by Ivan Moala on September 15, 0100 12:44 PM
Assuming the checkbox is an ActiveX control
available from the Control toolbox and
The row is 4 then;
Sub Hide()
Rows(4).EntireRow.Hidden = True
ActiveSheet.Shapes("CheckBox1").Visible = False
End Sub
Sub UnHide()
Rows(4).EntireRow.Hidden = False
ActiveSheet.Shapes("CheckBox1").Visible = True
End Sub
HTH
Ivan

Re: "Tying" checkboxes to cells
Posted by Ivan Moala on September 14, 0100 9:31 PM
I have a row that I only need visible a couple of months out of the year. When visible, each cell in the row has a checkbox in it. When I try to "Hide" the row, the row disappears but the checkboxes don't. It is very frustrating. I would like the checkboxes to "Hide" with the row. Currently I am having to delete and recreate the rows (and the checkboxes) everytime I need them. Let me know what you think,
Rick
Unfortunately you will have to hide the check box
via code. I.e accessing the objects visible property.
If you want code for this then post
Ivan

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.