Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Have ActiveX CheckBox become checked based on cell value greater than X. Using VBA

0

Hello,

I am trying to have "CheckBox" value become True when the Cell A1 value is greater or equalt to 100.

This is the code I have tried to no sucess:

Private Sub CheckBox_Change()
    If Range("E10").Value >= 100 Then
        Me.CheckBox.Value = True
        Else
        Me.CheckBox.Value = False
    End If
End Sub

I would appriciate any advice on the subject, thanks!

Answer
Discuss

Discussion

Please put CODE tags around your code. To do that, edit your post, select your code and click the CODE button.
don (rep: 1989) Jul 27, '16 at 10:39 pm
Add to Discussion

Answers

0
Selected Answer

You don't actually need VBA for this.

Go to another cell in your worksheet that is empty and enter this formula:

=IF(E10>=100,TRUE,FALSE)

Then go to the check box and right-click it > click Format Control > go to the Control tab > click inside the Cell link input area and then select the cell where you just placed the formula.

You can also hide the new formula so it doesn't disrupt your spreadsheet; just select the cell with the formula and change the text color to the same as the background color of the cell, usually white.

Discuss

Discussion

This is a much easier way to do this, seems to work fine. Thank you!
aorlowski (rep: 4) Jul 28, '16 at 10:38 am
Add to Discussion


Answer the Question

You must create an account to use the forum. Create an Account or Login