ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Marking Checkbox from VBA (https://www.excelbanter.com/excel-programming/323048-marking-checkbox-vba.html)

konpego

Marking Checkbox from VBA
 
Hello,

I have a range of cells ("B20:L20") all containing a checkbox. These
can be checked/un-checked from excel and then evaluated in VBA code.
But I would like to check/un-check them from inside the VBA code...

Is it possible to check/un-check a checkbox from VBA code?

/konpego

Bob Phillips[_6_]

Marking Checkbox from VBA
 
If it is a forms checkbox, then

activesheet.checkboxes("Check Box 1").Value = false (or True)

If it is a controls toolbox checkbox, then

activesheet.oleobjects("CheckBox1").object.value=f alse (or True)

--

HTH

RP
(remove nothere from the email address if mailing direct)


"konpego" wrote in message
...
Hello,

I have a range of cells ("B20:L20") all containing a checkbox. These
can be checked/un-checked from excel and then evaluated in VBA code.
But I would like to check/un-check them from inside the VBA code...

Is it possible to check/un-check a checkbox from VBA code?

/konpego




Neil

Marking Checkbox from VBA
 
Assuming your CheckBox is called CheckBox1, use

Checkbox1 = True
Checkbox1 = False

To change the status if the CheckBox.

Of course if your checkboxes are different names, then substitute those for
Checkbox1!


Neil


www.nwarwick.co.uk


"konpego" wrote:

Hello,

I have a range of cells ("B20:L20") all containing a checkbox. These
can be checked/un-checked from excel and then evaluated in VBA code.
But I would like to check/un-check them from inside the VBA code...

Is it possible to check/un-check a checkbox from VBA code?

/konpego



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

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