Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
bob bob is offline
external usenet poster
 
Posts: 12
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Check Box - Macro code Vicky Excel Discussion (Misc queries) 2 March 17th 09 08:28 AM
code to check condition for each row Horatio J. Bilge, Jr. Excel Discussion (Misc queries) 3 February 10th 09 08:07 PM
Please check my code!!!! Tdp Excel Discussion (Misc queries) 1 October 27th 08 02:39 PM
code to hide check boxes Matt Excel Programming 4 January 10th 04 06:31 PM
Check my code to use template? Ed[_9_] Excel Programming 1 July 23rd 03 03:04 AM


All times are GMT +1. The time now is 02:16 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"