Yet another “helper” script for marking CAT PAT‘s! I was modifying one of the Excel marking rubrics and to test that I had linked up all the calculations correctly with their checkboxes, I checked all of them. When it came to unchecking them all so that I could duplicate the workbook and start marking — well, you know — I thought: “There must be a better way!”…

For a short primer on VBA for Excel, start with the post Hello World Excel VBA.

Insert the following VBA in a Module in your Excel workbook and it will be available to run as a Macro:

Option Explicit

Sub ClearCheckBoxes()

    Dim wSheet As Worksheet
    Dim chkBox As Excel.CheckBox
    
    Application.ScreenUpdating = False
    For Each wSheet In ThisWorkbook.Worksheets
        For Each chkBox In wSheet.CheckBoxes
            chkBox.Value = xlOff
        Next chkBox
    Next
    
    Application.ScreenUpdating = True
End Sub

References:

By MisterFoxOnline

CAT Educator

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.