ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Creating a Check Box that produce true or false statement (https://www.excelbanter.com/excel-programming/400491-creating-check-box-produce-true-false-statement.html)

cyn

Creating a Check Box that produce true or false statement
 
Hi,

I've seen in someone's worksheet where they have a 2 check box, one that
says "No" and one that says "Yes", when you place your cursor to either one
of these box and click it a check mark appears in the box. If the box is
checked, it produce the word "True" in a different cell, if the box is not
checked, the same cell will have the word "False". I would like to know how
this is created.

Your help is much appreciated!!!! Thanks!!!!

Mekinnik

Creating a Check Box that produce true or false statement
 
Here is a few lines of code that worked for me. Just modify the beginning of
it to where you want it to be copied

ws.Cells(iRow, 3).Value = IIf(Me.CkBox1.Value, "Yes", "No")
ws.Cells(iRow, 4).Value = IIf(Me.CkBox2.Value, "Yes", "No")
ws.Cells(iRow, 5).Value = IIf(Me.CkBox3.Value, "Yes", "No")


"Cyn" wrote:

Hi,

I've seen in someone's worksheet where they have a 2 check box, one that
says "No" and one that says "Yes", when you place your cursor to either one
of these box and click it a check mark appears in the box. If the box is
checked, it produce the word "True" in a different cell, if the box is not
checked, the same cell will have the word "False". I would like to know how
this is created.

Your help is much appreciated!!!! Thanks!!!!


Jim Thomlinson

Creating a Check Box that produce true or false statement
 
2 possible solutions...

1 - From the Forms toolbar drag a check box control onto your sheet. Right
click the control and select Format Control. On the control Tab Place a cell
address in the Linked Cell box. Close the Format Control dialog. Now when you
click the check box you will get true or false in the Linked Cell.

2 - From the Control Toolbox drag a check box to your worksheet. Right click
the control and select properties. In the property Linked Cell add in a Cell
address. Close the properties dialog. Inthe control toolbox you need to exit
design mode by clicking the Ruler and Pencil icon. Once again you have a
check box that Adds tryue and false to the linked cell.
--
HTH...

Jim Thomlinson


"Cyn" wrote:

Hi,

I've seen in someone's worksheet where they have a 2 check box, one that
says "No" and one that says "Yes", when you place your cursor to either one
of these box and click it a check mark appears in the box. If the box is
checked, it produce the word "True" in a different cell, if the box is not
checked, the same cell will have the word "False". I would like to know how
this is created.

Your help is much appreciated!!!! Thanks!!!!



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

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