Uncheck Forms Check box via code

S

Steph

Hello all. I have the following bit of code:

Sub Uncheck()
For Each chbx In Worksheets("test").CheckBoxes
chbx.Value = False
Next
End Sub

I have workbooks with one checkbox on 100 sheets. How can I modify
the above code to uncheck each checkbox on every sheet?

Also, How could I modify it to check the box only on certain
predetermined sheets?

Thanks so much!

-Steph
 
R

Rob van Gelder

Sub test()
Dim wks As Worksheet, chbx As Object

For Each wks In Worksheets
For Each chbx In wks.CheckBoxes
chbx.Value = False
Next
Next
End Sub
 

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