ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   CheckBox in VBA (https://www.excelbanter.com/excel-programming/295698-checkbox-vba.html)

Stephane[_3_]

CheckBox in VBA
 
Hi,

I'm not able to find the right code to use correctly the checkbox.
It's not working. Here's the part of my code that is not working.

Worksheets("sheetname").Activate
ActiveSheet.OLEObjects("checkbox2").Object.Value = 1

I've tried to place those 2 lines in different places in my program
and I've also tried to change the name of the ckeckbox and I still can
not activate this checkbox.

What's the solution?????

No Name

CheckBox in VBA
 
try this
ActiveSheet.Shapes("CheckBox2").Select
Selection.Value = False

-----Original Message-----
Hi,

I'm not able to find the right code to use correctly the

checkbox.
It's not working. Here's the part of my code that is not

working.

Worksheets("sheetname").Activate
ActiveSheet.OLEObjects("checkbox2").Object.Valu e = 1

I've tried to place those 2 lines in different places in

my program
and I've also tried to change the name of the ckeckbox

and I still can
not activate this checkbox.

What's the solution?????
.


Bob Phillips[_6_]

CheckBox in VBA
 
Works for me. Are you sure it is a control toolbox checkbox?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Stephane" wrote in message
om...
Hi,

I'm not able to find the right code to use correctly the checkbox.
It's not working. Here's the part of my code that is not working.

Worksheets("sheetname").Activate
ActiveSheet.OLEObjects("checkbox2").Object.Value = 1

I've tried to place those 2 lines in different places in my program
and I've also tried to change the name of the ckeckbox and I still can
not activate this checkbox.

What's the solution?????





All times are GMT +1. The time now is 04:39 AM.

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