0

I have a checkbox on sheet1 (there are about 7 sheets total). If the checkbox is selected (true), I want it to say "Approved" in cell M9. If the checkbox is not selected (false), I want it to say "Denied" in the textbox.

Do I need to create a macro for that?

If I want it to display the same text in cell M5 of sheet2, how would I put it all together?

2 Answers 2

2

You can link the status of a checkbox to a cell (right-click, format control, cell link on the control tab), this means you can then refer to that cell in any other sheet or cell.

Sign up to request clarification or add additional context in comments.

11 Comments

Thanks, but I have no clue what type of code I would need for that. Any suggestions?
There is no code, just formulas: =If(a9, "a9 is true","Denied") Where are you having problems?
Don't you mean, =If checkbox1.value = true, "Denied" Would that work?
No, I do not mean checkbox1.value. And, no, it would not work. You need to link the checkbox to a cell, as described. You say you wish to put text in a cell based on a checkbox on sheet1. Why do you now wish to use code? Please update your question to show your new requirements.
The easiest way is fine. How do I link the checkbox to a cell?
|
1

Private Sub CheckBox1_Click()
If CheckBox1.Value = True Then
Range("M9").Value = "Approved"
Else
Range("M9").Value = "Denied"
Sheets("Sheet2").Range("M5").Value = "Denied"
End If
End Sub

2 Comments

Are you not thinking if a user form? The above code would need to be added to the checkbox on sheet1, surely it is easier to skip the code and simply link a cell?
This works great. Linking a cell would eliminate code, which would be a plus, but I don't know how to do it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.