vba loop through all activex checkboxes set to uncheck in Excel

Q191. In Excel, how can I loop through all ActiveX checkboxes in WorkSheet and set them to "Unchecked" status?

To do it in Excel, here is the answer:

  1. Option Explicit
  2. Sub UnCheckAllCheckBoxes()
  3. Dim objControl As Object
  4. ''
  5. For Each objControl In ActiveSheet.OLEObjects
  6. If TypeName(objControl.Object) = "CheckBox" Then
  7. objControl.Object.Value = False
  8. End If
  9. Next
  10. End Sub

Description:

a) Line 5 - Loop through all ActiveX controls in ActiveSheet.

b) Line 6 - Check if Type of Control Object is "CheckBox"

c) Line 7 - If Type of Control Object is "CheckBox", then set it to FALSE.

 

You can find similar Excel Questions and Answer hereunder

1) How do I add a shape using VBA?

2) Vba list all files in a folder in Excel

3) How do I assign a macro to a shape using VBA?

4) How can I clear cell after activating a routine when there is a change in value of a cell?

5) Line break in vba message box in Excel

6) How do I copy a Table from one location to another and retain all formulas, formats and columnwidths?

7) Determine if hyperlinks are valid in Excel

8) How can I change the Marker size and Marker line color for all the series in a chart?

9) How can I add a legend to a chart using VBA?

10) How can I add a Timestamp after macro execution?

11) How do I use Find to determine last occurrence of a string in a WorkSheet range using VBA?

12) How do I restrict user entry in ActiveX Text Box to just numeric values?

13) How can I get input from user through a prompt and assign user's input to a cell?

14) How do I update my DropDown list whenever the sheet is activated?

15) How can I set FreezePanes in a certain range using VBA?