ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   test value of yes/no box (https://www.excelbanter.com/excel-programming/422777-test-value-yes-no-box.html)

vtj

test value of yes/no box
 
I'm new to Excel programing - have some Access programming. I have a column
that has yes/no boxes in Excel. Is there a way to test the entry to see if
it is yes or no? I'm thinking about a VBA If statement. I would select the
row and column to be checked and then use the If statement to determine one
of two actions to be done. I have tried using the .value with True, False,
Y, T, 0, -1, F, and N for the .value being equal to but none of them work.
Maybe .value is not the proper value to test? In Access you can test for
true or false. There is obviously something that I am totally missing. Any
pointers gladly accepted.

Jim Thomlinson

test value of yes/no box
 
Can you define Yes/No box. Are you using check boxes, option buttons, drop
down combo boxes or data validaton lists? If it is anything other than the
data validation list did you get the object from the Forms Toolbar of the
Control Toolbox?
--
HTH...

Jim Thomlinson


"vtj" wrote:

I'm new to Excel programing - have some Access programming. I have a column
that has yes/no boxes in Excel. Is there a way to test the entry to see if
it is yes or no? I'm thinking about a VBA If statement. I would select the
row and column to be checked and then use the If statement to determine one
of two actions to be done. I have tried using the .value with True, False,
Y, T, 0, -1, F, and N for the .value being equal to but none of them work.
Maybe .value is not the proper value to test? In Access you can test for
true or false. There is obviously something that I am totally missing. Any
pointers gladly accepted.


vtj

test value of yes/no box
 
It is check box form control from the insert tab. I am trying to test the
value or condition of the box.

"Jim Thomlinson" wrote:

Can you define Yes/No box. Are you using check boxes, option buttons, drop
down combo boxes or data validaton lists? If it is anything other than the
data validation list did you get the object from the Forms Toolbar of the
Control Toolbox?
--
HTH...

Jim Thomlinson


"vtj" wrote:

I'm new to Excel programing - have some Access programming. I have a column
that has yes/no boxes in Excel. Is there a way to test the entry to see if
it is yes or no? I'm thinking about a VBA If statement. I would select the
row and column to be checked and then use the If statement to determine one
of two actions to be done. I have tried using the .value with True, False,
Y, T, 0, -1, F, and N for the .value being equal to but none of them work.
Maybe .value is not the proper value to test? In Access you can test for
true or false. There is obviously something that I am totally missing. Any
pointers gladly accepted.


JLGWhiz

test value of yes/no box
 
For a checkbox from the Control Tool Box:

Sub TF()
MsgBox ActiveSheet.Checkbox1.Value 'Reurns True/False
End Sub

For a checkbox from the Forms tool bar:
'This returns numerical values of -4126 for False and 1 for True
Sub Vlu()
MsgBox ActiveSheet.DrawingObjects("Check Box 1").Value
End Sub







"vtj" wrote:

It is check box form control from the insert tab. I am trying to test the
value or condition of the box.

"Jim Thomlinson" wrote:

Can you define Yes/No box. Are you using check boxes, option buttons, drop
down combo boxes or data validaton lists? If it is anything other than the
data validation list did you get the object from the Forms Toolbar of the
Control Toolbox?
--
HTH...

Jim Thomlinson


"vtj" wrote:

I'm new to Excel programing - have some Access programming. I have a column
that has yes/no boxes in Excel. Is there a way to test the entry to see if
it is yes or no? I'm thinking about a VBA If statement. I would select the
row and column to be checked and then use the If statement to determine one
of two actions to be done. I have tried using the .value with True, False,
Y, T, 0, -1, F, and N for the .value being equal to but none of them work.
Maybe .value is not the proper value to test? In Access you can test for
true or false. There is obviously something that I am totally missing. Any
pointers gladly accepted.



All times are GMT +1. The time now is 10:54 PM.

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