Checkbox doing one action when checked and another when not

zerdan

New Member
Joined
Apr 12, 2011
Messages
7
This should be easy. I have read through the forums and found many examples of this and it seems very straight forward. I have used the examples other people have had without success.

What I'm trying to do seems pretty simple to me. I want a checkbox on one sheet (let's call it "A"). When checked it will add a series of 1's to a column in a different sheet (let's call it "B"). When unchecked it will clear these 1's that it added.

Code:
Sub CheckBox1_Click()
    With Sheets("B")
        If CheckBox1 = True Then
            .Range("A2:A12").Value = 1
        Else
            .Range("A2:A12").Clear
        End If
 End With
End Sub

With this I can clear the Range no problem, but I cannot add the 1's. Any suggestions? I'm stuck. It seems like it just skips the If CheckBox1 = True Then line.
 
So I figured out where a lot of the confusion was coming. Apparently, none of the ActiveX stuff is supported on Mac so you only have the form controls. They really dumb down those even and make them difficult to use.

I have since switched to using Excel on windows and things are running very smoothly now. Thanks for the help!
 
Upvote 0

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

Forum statistics

Threads
1,224,597
Messages
6,179,808
Members
452,944
Latest member
2558216095

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