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:
I used "CheckBox2" because that is how it is listed in the properties box without any modifications by me. ????
:confused: You told me you used a Forms Checkbox, but what you said above would suggest you actually used an ActiveX Checkbox. If that is the case, then your code line should be this instead...

If sh.CheckBox2.Value = False Then GoTo a

Note that all I added to the front of the Checkbox name is a reference to the sheet it is on.
 
Upvote 0
:confused: You told me you used a Forms Checkbox, but what you said above would suggest you actually used an ActiveX Checkbox. If that is the case, then your code line should be this instead...

If sh.CheckBox2.Value = False Then GoTo a

Note that all I added to the front of the Checkbox name is a reference to the sheet it is on.

When I did this my error is now "Method or Data member not found."
Thanks - JA
 
Last edited:
Upvote 0
When I did this my error is now "Method or Data member not found."
Any chance you can post a copy of your workbook to OneDrive, DropBox or some other such free file sharing facility so we can see exactly what you have, where you have it and debug our code with your live data?
 
Upvote 0
Any chance you can post a copy of your workbook to OneDrive, DropBox or some other such free file sharing facility so we can see exactly what you have, where you have it and debug our code with your live data?

Thanks for your help - I really appreciate it.
I can post it in One Drive this evening.
Thanks again - Jim A
 
Upvote 0
The above link no longer works
That is probably because it contained what looked like real people's names along with other data associated with those names that seemed kind of personal, so I wrote the OP a private message advising him to remove it... I am assuming he has now done that. As it turns out, the file would not have been helpful in that it used Excel Online and it appears that ActiveX components may not be supported in it as all the CheckBoxes and Buttons that are referenced in his file appeared only as Rectangle shapes.
 
Last edited:
Upvote 0

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