ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Uncheck Forms Check box via code (https://www.excelbanter.com/excel-programming/293880-uncheck-forms-check-box-via-code.html)

Steph[_3_]

Uncheck Forms Check box via code
 
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

Rob van Gelder[_4_]

Uncheck Forms Check box via code
 
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


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Steph" wrote in message
m...
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





All times are GMT +1. The time now is 03:45 PM.

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