Excel Checkbox Clearing

  • Thread starter Thread starter gotgame0314
  • Start date Start date
G

gotgame0314

I have a sheet with checkboxes that were placed from the contro
toolbox. Is there a way to clear all the checkboxes on the sheet usin
a command button

Thank
 
Hi GotGame,

Try assigning the following code to the command button:

'=============>>
Sub Tester01()
Dim Ctl As OLEObject

For Each Ctl In Worksheets("Sheet1").OLEObjects
If TypeOf Ctl.Object Is MSForms.CheckBox Then
Ctl.Object.Value = False
End If
Next Ctl
End Sub
'<<=============


---
Regards,
Norman



"gotgame0314" <[email protected]>
wrote in message
news:[email protected]...
 
Or just use it as:

Sub CommandButton1_Click()
(still under that same worksheet)
 

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

Back
Top