Check Box troubles

jimayers

Board Regular
Joined
Nov 14, 2010
Messages
99
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

Code:
If sh.Name = "Waiting List" Then
        [COLOR=#0000ff]If CheckBox2.Value = False [/COLOR]Then GoTo a
        Call UpDatebyDR_EdRoster_BHousing_NO_Sort
        Call count
        MsgBox (sh.Name & " updated.")
        GoTo a
End If


The full code is:

Code:
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
        [COLOR=#000080]If CheckBox2.Value = False [/COLOR]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
 
Last edited:

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
How did you create the checkbox and where is it located?
 
Upvote 0
Forms....
Try changing the line of code you highlighted in Message #1 to this and see if it works for you...

If sh.Checkboxes("Check Box 2").Value = False Then GoTo a

Note: I assumed you did not change the default name of the Checkbox, which is "Check Box 2", not CheckBox2 like you referred to it as. If you did change the name from its default, then use that in place of what I highlighted in blue.
 
Last edited:
Upvote 0
Note: I assumed you did not change the default name of the Checkbox, which is "Check Box 2", not CheckBox2 like you referred to it as. If you did change the name from its default, then use that in place of what I highlighted in blue.

I used "CheckBox2" because that is how it is listed in the properties box without any modifications by me. ????
 
Upvote 0
If when you right click the checkbox you have the option Properties it's an ActiveX checkbox not a Forms checkbox.
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,717
Members
448,985
Latest member
chocbudda

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top