Hiding check boxes on a worksheet.

H

havocdragon

Hey all. I am not sure why (im using excel 2000) but I have a few rows of
checkboxes with macros, that can not be hidden. For various reasons I need
them to be hidden at times. Is there a way to do this?
 
C

Chip Pearson

If these are check boxes from the Controls command bar, use

Sheet1.CheckBox1.Visible = True

If thes are check boxes from the Forms command bar, use

ActiveSheet.Shapes("Check box 2").Visible = True


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




message
news:[email protected]...
 
C

Chip Pearson

Of course, to hide the check boxes, set the Visible property to
False, not True.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
D

Dave Peterson

You didn't say what type of checkboxes they are:

From the controltoolbox toolbar:
Option Explicit
Sub testme()

Dim OLEobj As OLEObject

For Each OLEobj In ActiveSheet.OLEObjects
If TypeOf OLEobj.Object Is msforms.CheckBox Then
OLEobj.Visible = False
End If
Next OLEobj

End Sub

From the Forms toolbar:
Option Explicit
Sub testme2()

Dim CBX As CheckBox

'this usually works, but breaks with lots of checkboxes!
ActiveSheet.CheckBoxes.Visible = False

'this'll be slower, but shouldn't break
For Each CBX In ActiveSheet.CheckBoxes
CBX.Visible = False
Next CBX

End Sub
 
Top