Check Box Format!

  • Thread starter Thread starter Kim-Anh Tran
  • Start date Start date
K

Kim-Anh Tran

I have a check box. I would like to have this happens:
1. When the box is checked, it will appear "Y" in cell B4.
2. When it is unchecked, it will appear "N" in cell B4.
How do I make this happens?

Thanks in advance for your help!
Kim-An
 
Add this code (assumes name of checkbox is CheckBox1):

Private Sub CheckBox1_Click()
If CheckBox1.Value Then
Range("B4").Value = "Y"
Else
Range("B4").Value = "N"
End If
End Sub
 
I forgot that cell "B4" is in another sheet!
How do I indicate the location of the cell B4?
Thanks again!
Kim-An
 
Private Sub CheckBox1_Click()
With Worksheets("Sheet5")
If CheckBox1.Value Then
.Range("B4").Value = "Y"
Else
.Range("B4").Value = "N"
End If
End With
End Sub
 
Check box40 is in sheet 1 and Cell "B4" is in sheet 2.
I appreciate anyone help to fix this problem! I have the error message
"Can't execute code in break mode"

Private Sub CheckBox40_Click()
With Worksheets("sheet 2")
If CheckBox40.Value Then
Range("B4").Value = "Y"
Else
Range("B4").Value = "N"
End If
End With
End Su
 
The message means code execution has been stopped (it is taking a "break".).
Either an error has paused execution for debug mode or you have paused
execution, yet the checkbox is trying to execute its code. Reset the code.
On the Run menu, click Reset <yourprojectname> and try again.
 

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

Similar Threads

macro to run in event of cell value <>"" 3
If Condition 4
INDIRECT Syntax 1
Conditional Formating (If statements) 4
Help with hyperlinks 2
formula help please 2
PROGRAMME HELP 2
How to do this with macro? 2

Back
Top