• 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.

Checkbox [macro would work if tick or untick the checkbox]

Hello!

Need your help in below condition;

In the attached file, if I click on check-box then range A2:A10 must be filled with "hello". But if I remove the tick from checkbox then same range must be cleared.

The reason behind "hello" is, I just want to know how the check-box function works, once I get some solution then I'll replace the "hello" to some formula or other macro coding.

Thanks in advance!

Regards,
Mehmud
 
Paste in the sheet module :

Code:
Option Explicit


Sub CheckBox1_Click()

    If CheckBox1.Value = True Then
        Range("A1:A10").Value = "Hello"
    Else
        Range("A1:A10").Value = ""
    End If

End Sub

Rather than using the UserForm checkbox control ... use the ActiveX checkbox control.
 

Attachments

  • Checkbox_run_test.xlsb
    19.5 KB · Views: 4
Back
Top