True or False for a check box

D

Doug

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.
 
R

Ryan H

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.
 
D

Doug

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?
 
R

Ryan H

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top