Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default reset ALL checkboxes (created with control toolbar) with the click of ONE BUTTON

No question, just an FYI

I personally was looking for a short, simple code to reset all of my
checkboxes I created with the control toolbar with the touch of one
button. I found code with reference to sort objects posted by Dave
Peterson. After a quick touch up of his original code, I came up with
this code and it works perfectly!


Private Sub CommandButtonRESETform_Click()
Dim Ctrl As OLEObject
Dim SH As Worksheet

Set SH = Worksheets("Sheet1") '<<==== CHANGE

For Each Ctrl In SH.OLEObjects
With Ctrl
If TypeOf .Object Is MSForms.CheckBox Then ' searches
for all checkboxes
.Object.Value = False
' "unchecks" each checkbox
End If
End With
Next Ctrl

End Sub


Thank you Dave for saving me from unchecking over 100 checkboxes to
clean a sheet!

Kat

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hiding Control Toolbar Checkboxes Ellen G Excel Discussion (Misc queries) 2 September 24th 07 09:59 PM
How to add the Enter key as a button to a formula toolbar created O'Malley Excel Discussion (Misc queries) 4 July 27th 07 04:24 AM
How to reset checkboxes from control tool box? [email protected] Excel Programming 11 August 24th 06 08:13 PM
Reset Checkboxes from Control Tool Box Robert Excel Programming 7 August 22nd 06 05:36 AM
Second Click on Control Button iamjbunni Excel Programming 4 August 1st 06 10:51 PM


All times are GMT +1. The time now is 01:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"