Excel: Check Box troubles


Hello - I could use some help. I am not understanding how to use checkbox's. I would appreciate any help or advise on why the following code doesn't work. I get an "Object Required" error when it comes to the checkbox.2

    
If sh.Name = "Waiting List" Then
        If CheckBox2.Value = False Then GoTo a
        Call UpDatebyDR_EdRoster_BHousing_NO_Sort
        Call count
        MsgBox (sh.Name & " updated.")
        GoTo a
End If
The full code is:

Sub UpDate_Workbook()
Application.ScreenUpdating = False
Dim MacroWb As Workbook
Dim sh As Worksheet
Set MacroWb = Workbooks("MACROS-Student List_3.xlsm")
For Each sh In MacroWb.Worksheets
    If sh.Name = "SMs" Then GoTo a
    If sh.Name = "Yard" Then GoTo a
    If sh.Name = "Waiting List" Then
        If CheckBox2.Value = False Then GoTo a
        Call UpDatebyDR_EdRoster_BHousing_NO_Sort
        Call count
        MsgBox (sh.Name & " updated.")
        GoTo a
    End If
    If sh.Name = "FULL Class List" Then
            If CheckBox2.Value = True Then Call UpDatebyDR_EdRoster_BHousing 'trying different way, using true not false
        MsgBox (sh.Name & " updated.")
        GoTo a
    End If
    If sh.Name = "TABE" Then
        If CheckBox2.Value = False Then GoTo a
        Call UpDateTABE
        MsgBox (sh.Name & " updated.")
        GoTo a
    End If
If CheckBox2.Value = False Then GoTo a
    Call UpDatebyDR_EdRoster_BHousing
     MsgBox (shName & " updated.")
    End With
a:
Next sh
Application.ScreenUpdating = True
End Sub
Thanks for any help or explanation - Jim A


This question generated 19 answers. To proceed to the answers, click here.

This thread is current as of March 17, 2017.


For more resources for Microsoft Excel