ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Clear check boxes? (https://www.excelbanter.com/excel-programming/436884-re-clear-check-boxes.html)

Dave Peterson

Clear check boxes?
 
Just a different take on Mike's suggestion...

I'd test the object this way:

Sub Test()
'from the Controls toolbar
Dim obj As OLEObject
For Each obj In ActiveSheet.OLEObjects
If typeof obj.object is msforms.checkbox Then
obj.Object = False
End If
Next obj
End Sub

For me, it's safer than making sure I type: "Forms.CheckBox.1"
correctly--spelled correctly and in the correct case.

And if the checkboxes are from the forms toolbar:

Sub Test2()
'from the Forms toolbar
ActiveSheet.CheckBoxes = xloff
End Sub

It may blow up if you have lots and lots (whatever that means) of checkboxes.

Geoff wrote:

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.


--

Dave Peterson


All times are GMT +1. The time now is 12:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com