Clear check boxes?

G

Geoff

Excel 2007:

I have a sheet that has oodles of check boxes. Is there a simple way to
automate resetting the values of them to zero. The check boxes are not tied
to any cell value.
 
M

Mike H

Geoff,

How depends on which toolbox you used, here's both ways

Sub Test()
'from the Controls tolbar
Dim obj As OLEObject
For Each obj In ActiveSheet.OLEObjects
If obj.progID = "Forms.CheckBox.1" Then
obj.Object = False
End If
Next obj
End Sub

Sub Test2()
'from the Forms tolbar
Dim obj As CheckBox
For Each obj In ActiveSheet.CheckBoxes
obj.Value = False
Next obj

End Sub


Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top