Vba loop through all activex checkboxes set to uncheck in Excel
To do it in Excel, here is the answer:
- Option Explicit
- Sub UnCheckAllCheckBoxes()
- Dim objControl As Object
- ''
- For Each objControl In ActiveSheet.OLEObjects
- If TypeName(objControl.Object) = "CheckBox" Then
- objControl.Object.Value = False
- End If
- Next
- 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.