ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   True or False for a check box (https://www.excelbanter.com/excel-programming/437505-true-false-check-box.html)

Doug

True or False for a check box
 
I have a check box at the top of my sheet. I have a linked cell right next to
it that says either True or False. How can I get that to show different text?
Do I need to assign a macro and if so how would it be written. I want it to
either say "Good" when checked instead of true and "Bad" when unchecked
instead of False.

--
Thank you!

Ryan H

True or False for a check box
 
You can paste this in a standard module and assign this macro to the
checkbox. Label the sheet and cell to suit your application. You can also
get rid of the linked cell if you don't need it anymore.

Sub GoodBad()

With Sheets("Sheet1")
If .CheckBoxes("Check Box 4").Value = xlOn Then
.Range("A1").Value = "GOOD"
Else
.Range("A1").Value = "BAD"
End If
End With

End Sub

Hope this helps! If so, please click "YES" below.

--
Cheers,
Ryan


"Doug" wrote:

I have a check box at the top of my sheet. I have a linked cell right next to
it that says either True or False. How can I get that to show different text?
Do I need to assign a macro and if so how would it be written. I want it to
either say "Good" when checked instead of true and "Bad" when unchecked
instead of False.

--
Thank you!


Doug

True or False for a check box
 
It works great! Do you happen to know though if the original True or False
can be changed or is that standard for a checkbox? Reason I ask is because it
shows the true and false prior to the Macro changing it to Good or Bad?


"Ryan H" wrote:

You can paste this in a standard module and assign this macro to the
checkbox. Label the sheet and cell to suit your application. You can also
get rid of the linked cell if you don't need it anymore.

Sub GoodBad()

With Sheets("Sheet1")
If .CheckBoxes("Check Box 4").Value = xlOn Then
.Range("A1").Value = "GOOD"
Else
.Range("A1").Value = "BAD"
End If
End With

End Sub

Hope this helps! If so, please click "YES" below.

--
Cheers,
Ryan


"Doug" wrote:

I have a check box at the top of my sheet. I have a linked cell right next to
it that says either True or False. How can I get that to show different text?
Do I need to assign a macro and if so how would it be written. I want it to
either say "Good" when checked instead of true and "Bad" when unchecked
instead of False.

--
Thank you!


Ryan H

True or False for a check box
 
A checkboxes value will always be True or False or sometimes Null. I
seriously doubt that could be changed. If the true/false bothers you I would
just delete the linked cell property of the checkbox.
--
Cheers,
Ryan


"Doug" wrote:

It works great! Do you happen to know though if the original True or False
can be changed or is that standard for a checkbox? Reason I ask is because it
shows the true and false prior to the Macro changing it to Good or Bad?


"Ryan H" wrote:

You can paste this in a standard module and assign this macro to the
checkbox. Label the sheet and cell to suit your application. You can also
get rid of the linked cell if you don't need it anymore.

Sub GoodBad()

With Sheets("Sheet1")
If .CheckBoxes("Check Box 4").Value = xlOn Then
.Range("A1").Value = "GOOD"
Else
.Range("A1").Value = "BAD"
End If
End With

End Sub

Hope this helps! If so, please click "YES" below.

--
Cheers,
Ryan


"Doug" wrote:

I have a check box at the top of my sheet. I have a linked cell right next to
it that says either True or False. How can I get that to show different text?
Do I need to assign a macro and if so how would it be written. I want it to
either say "Good" when checked instead of true and "Bad" when unchecked
instead of False.

--
Thank you!


Doug

True or False for a check box
 
Thank you so much. Have a good time with your family for the Christmas Holiday!


"Ryan H" wrote:

A checkboxes value will always be True or False or sometimes Null. I
seriously doubt that could be changed. If the true/false bothers you I would
just delete the linked cell property of the checkbox.
--
Cheers,
Ryan


"Doug" wrote:

It works great! Do you happen to know though if the original True or False
can be changed or is that standard for a checkbox? Reason I ask is because it
shows the true and false prior to the Macro changing it to Good or Bad?


"Ryan H" wrote:

You can paste this in a standard module and assign this macro to the
checkbox. Label the sheet and cell to suit your application. You can also
get rid of the linked cell if you don't need it anymore.

Sub GoodBad()

With Sheets("Sheet1")
If .CheckBoxes("Check Box 4").Value = xlOn Then
.Range("A1").Value = "GOOD"
Else
.Range("A1").Value = "BAD"
End If
End With

End Sub

Hope this helps! If so, please click "YES" below.

--
Cheers,
Ryan


"Doug" wrote:

I have a check box at the top of my sheet. I have a linked cell right next to
it that says either True or False. How can I get that to show different text?
Do I need to assign a macro and if so how would it be written. I want it to
either say "Good" when checked instead of true and "Bad" when unchecked
instead of False.

--
Thank you!



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

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