Clear all checkboxes

  • Thread starter Thread starter Todd
  • Start date Start date
T

Todd

I have 80 checkboxes that when I press a command button
that is linked to the code it will clear the checkobxes.
My code is like the follwing:
Worksheets("Sheet1").Checkbox1.Value=False

Instead of having to use this code for all 80 checkboxes,
is there any code that I can use to clear all the
checkboxes on this worksheet at once? Thanks for the help!
 
Todd, give this a try

Sub Clear_CheckBoxs()
Dim oCtl As OLEObject
For Each oCtl In Sheet1.OLEObjects
If TypeOf oCtl.Object Is MSForms.CheckBox _
Then oCtl.Object.Value = False
Next
End Sub

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 2003
** remove news from my email address to reply by email **
 

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

Similar Threads


Back
Top