• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to trigger a macro on the basis of check box tick.

ThrottleWorks

Excel Ninja
Sir, I want to trigger a macro on the basis of check box tick.

I have inserted a check box in the file (Developer, Insert, Form Control).


My question is if the user ticks on check box (which is a true value) the macro should be triggered.


Is it possible, can anyone help me in this please.
 
You'll need to use an ActiveX control instead of form (Developer, Insert, ActiveX control.

Once you;ve placed the macro, (and you're still in design mode) you can double click on the control and it should take you to the VBE with something a shell macro like this:

Code:
Private Sub CheckBox1_Click()
 
End Sub
Simply place a run command within here, or write the code that you need.
 
Example:
 
Private Sub CheckBox1_Click()
MyMacro
End Sub
 
Sub MyMacro()
'do cool stuff
End Sub
 
Back
Top