ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Turn Check box on? (https://www.excelbanter.com/excel-programming/372378-turn-check-box.html)

John

Turn Check box on?
 
I have a check box which I would like to turn on... or not turn off in some
code that I previously had turning off all check boxes in the sheet. Here is
the code.

With ActiveSheet
..CheckBoxes = False
End With
ActiveSheet.CBX_R3 = True
ActiveSheet.CBX_R4 = True

is it possible I have the checkbox name's wrong?

Thanks for your help!

John

Turn Check box on?
 
With ActiveSheet
..CheckBoxes = False
End With
ActiveSheet.CheckBoxes("CBX_R3") = True
ActiveSheet.CheckBoxes("CBX_R4") = True

"John" wrote:

I have a check box which I would like to turn on... or not turn off in some
code that I previously had turning off all check boxes in the sheet. Here is
the code.

With ActiveSheet
.CheckBoxes = False
End With
ActiveSheet.CBX_R3 = True
ActiveSheet.CBX_R4 = True

is it possible I have the checkbox name's wrong?

Thanks for your help!


Sriram

Turn Check box on?
 
You can also set/unset the value as follows:

objSheet.CheckBoxes(1).Value = 1 'Checked, 0-unchecked.

....

"John" wrote:

With ActiveSheet
.CheckBoxes = False
End With
ActiveSheet.CheckBoxes("CBX_R3") = True
ActiveSheet.CheckBoxes("CBX_R4") = True

"John" wrote:

I have a check box which I would like to turn on... or not turn off in some
code that I previously had turning off all check boxes in the sheet. Here is
the code.

With ActiveSheet
.CheckBoxes = False
End With
ActiveSheet.CBX_R3 = True
ActiveSheet.CBX_R4 = True

is it possible I have the checkbox name's wrong?

Thanks for your help!



All times are GMT +1. The time now is 06:05 AM.

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