How do I clear all Checkboxes on a worksheet on open

  • Thread starter Thread starter wapfu
  • Start date Start date
W

wapfu

Excel 2003.
When a worksheet opens I wish to be able to set all
checkboxes to false . There are 15 checkboxes on the
sheet.
Regards
 
wapfu

Checkboxes from the Control Toolbox or the Forms toolbar?
 
Wapfu

This sub will clear all the checkboxes on sheet1

Sub ClearAllCB()

Dim oleCheck As OLEObject

For Each oleCheck In Sheet1.OLEObjects
If TypeName(oleCheck.Object) = "CheckBox" Then
oleCheck.Object.Value = False
End If
Next oleCheck

End Sub
 
Thanks,
Very very appreciated.
Warm Regards
Wapfu
-----Original Message-----
Wapfu

This sub will clear all the checkboxes on sheet1

Sub ClearAllCB()

Dim oleCheck As OLEObject

For Each oleCheck In Sheet1.OLEObjects
If TypeName(oleCheck.Object) = "CheckBox" Then
oleCheck.Object.Value = False
End If
Next oleCheck

End Sub

--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com




.
 

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

Back
Top