ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Macro to tick checkbox automatically (https://www.excelbanter.com/excel-discussion-misc-queries/74615-macro-tick-checkbox-automatically.html)

PaulJ

Macro to tick checkbox automatically
 
Hi,
I have a spreadsheet with a macro assigned to a button, with a checkbox
(from the control toolbar) next to this button for the user to manually tick
when they have run the macro. Is there a way for the checkbox to be ticked
automatically when the button is clicked?
Thanks!

Tom Ogilvy

Macro to tick checkbox automatically
 
Just add code in the macro assigned to the button

Activesheet.CheckBox1.Value = true

--
Regards,
Tom Ogilvy


"PaulJ" wrote in message
...
Hi,
I have a spreadsheet with a macro assigned to a button, with a checkbox
(from the control toolbar) next to this button for the user to manually

tick
when they have run the macro. Is there a way for the checkbox to be

ticked
automatically when the button is clicked?
Thanks!




PaulJ

Macro to tick checkbox automatically
 
Thanks Tom, I've adapted this slightly as my checkboxes aren't necessarily
CheckBox1. I've inserted the following code into my macro and it works
nicely:

With ActiveSheet
.Checkboxes.Value = True
End With

I wondered if anyone knows whether checkboxes can be protected? Ideally I
would like my macro to determine whether the checkbox is ticked or not.

Regards, Paul

"Tom Ogilvy" wrote:

Just add code in the macro assigned to the button

Activesheet.CheckBox1.Value = true

--
Regards,
Tom Ogilvy


"PaulJ" wrote in message
...
Hi,
I have a spreadsheet with a macro assigned to a button, with a checkbox
(from the control toolbar) next to this button for the user to manually

tick
when they have run the macro. Is there a way for the checkbox to be

ticked
automatically when the button is clicked?
Thanks!






All times are GMT +1. The time now is 03:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com