Vba loop through all activex checkboxes set to uncheck in Excel

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


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) Here a explanation about the global seek function in VBA. Goal Seek is another tool under What If analysis that does a unique function as Scenario Manager.

2) How to do a nested loop in VBA or a loop in a loop

3) I have a macro that takes a lot of time for execution - how can I keep the user informed that the macro is running?

4) Import txt file in Excel

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

6) How to hide and unhide rows and columns in excel VBA

7) How can worksheet functions be accessed in VBA?

8) How can I hide all comments in my WorkSheet using VBA?

9) How to add a link in a sheet to another sheet

10) How to create charts in Excel VBA


Here the previous and next chapter