Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check Box Code
How do you make if True, Display the value of Sheet2 Cell B4? Below will not work
Private Sub CheckBox1_Click( With CheckBox If CheckBox1.Value = True Then ActiveSheet.Range("A2").Value = "Sheet2!$B$4 If CheckBox1.Value = False Then ActiveSheet.Range("A2") = " End Wit End Su Thank you |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check Box Code
Try putting true and false in quotes. Like "True"
and "False". Remember it's case sensitive. -----Original Message----- How do you make if True, Display the value of Sheet2 Cell B4? Below will not work. Private Sub CheckBox1_Click() With CheckBox1 If CheckBox1.Value = True Then ActiveSheet.Range ("A2").Value = "Sheet2!$B$4" If CheckBox1.Value = False Then ActiveSheet.Range ("A2") = "" End With End Sub Thank you . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check Box Code
Private Sub CheckBox1_Click()
If CheckBox1.Value = True Then ActiveSheet.Range("A2").Value = "Sheet2!$B$4" If CheckBox1.Value = False Then ActiveSheet.Range("A2") = "" End Sub or Private Sub CheckBox1_Click() With CheckBox1 If .Value = True Then ActiveSheet.Range("A2").Value = "Sheet2!$B$4" If .Value = False Then ActiveSheet.Range("A2") = "" End With End Sub --- Message posted from http://www.ExcelForum.com/ |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check Box Code
Watch for word wrap:
Private Sub CheckBox1_Click() With CheckBox1 If .Value = True Then ActiveSheet.Range("A2").Value = Range("Sheet2!$B$4").Value If .Value = False Then ActiveSheet.Range("A2").Value = "" End With End Sub or possibly Private Sub CheckBox1_Click() If CheckBox1.Value = True Then ActiveSheet.Range("A2").Value = Range("Sheet1!$B$4").Value Else ActiveSheet.Range("A2") = "" End If End Sub "Bob" wrote in message ... How do you make if True, Display the value of Sheet2 Cell B4? Below will not work. Private Sub CheckBox1_Click() With CheckBox1 If CheckBox1.Value = True Then ActiveSheet.Range("A2").Value = "Sheet2!$B$4" If CheckBox1.Value = False Then ActiveSheet.Range("A2") = "" End With End Sub Thank you |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Check Box - Macro code | Excel Discussion (Misc queries) | |||
code to check condition for each row | Excel Discussion (Misc queries) | |||
Please check my code!!!! | Excel Discussion (Misc queries) | |||
code to hide check boxes | Excel Programming | |||
Check my code to use template? | Excel Programming |