Clear Check Boxes Without VBA

Vampyre

New Member
Joined
Mar 23, 2011
Messages
30
Hi, I have an autoshape , that im using as a button to clear the rest of my form. i want to use this to also clear 2 clusters of check boxes.

Im not very hot on vba and would really like to do it using a macro, any ideas ??

as simple as possible please

Cheers
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Macros are VBA. ;)

What kind of checkboxes are they - Forms or ActiveX?
 
Upvote 0
There is no Design menu, so can you be more specific?
Alternatively, if you right-click one, does anything happen?
 
Upvote 0
Sorry , design tool bar.

when i right click , i get the general options copy, paste etc and at the bottom there is 'format control' and 'assign macro'
 
Upvote 0
There is no Design toolbar, but I'll assume these are Forms checkboxes based on your last comment. Are they the only checkboxes on the sheet? If not, how would the code identify them?
 
Upvote 0
yeah i only have eight , going in to look at properties gives me there name e.g. checkbox88
 
Upvote 0
OK, now I'm confused. If you have a properties window then they are ActiveX not Forms controls, and you shouldn't have an Assign Macro option when right-clicking.

Anyway, here's the code for both - you can try them and see!
Code:
Sub ResetActiveXCheckBoxes()
   Dim objole As OLEObject
   For Each objole In ActiveSheet.OLEObjects
      If TypeName(objole.Object) = "CheckBox" Then
         objole.Object.Value = False
      End If
   Next objole
End Sub
Sub ResetFormsCheckBoxes()
   Dim cb As CheckBox
   For Each cb In ActiveSheet.CheckBoxes
      cb.Value = False
   Next cb
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,587
Messages
6,179,735
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top