ExcelBanter

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

Geoff[_5_]

Clear check boxes?
 
Test2 was just what i needed and works like a charm. Thank you very much!

"Mike H" wrote:

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



All times are GMT +1. The time now is 04:53 AM.

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