Macro to Display String on Checkbox Select
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?
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.
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
精彩评论