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 Does Not Work

I have had four suggestions on how to make this work and so far none will work. Now the True Statement has something wrong.

Can anyone help?

Private Sub CheckBox1_Click()
With CheckBox1
If .Value = True Then
ActiveSheet.Range("A2").Value = Range("Sheet2!$B$4").Value
Else
If .Value = False Then
ActiveSheet.Range("A2") = ""
End If
End If
End With
End Sub

Thank You very much

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Check Box Code Does Not Work

Man, attitude. we're trying to help.

First, the code should be

Private Sub CheckBox1_Click()
With CheckBox1
If .Value = True Then
ActiveSheet.Range("A2").Value = _
Worksheets("Sheet2").Range("$B$4").Value
Else
ActiveSheet.Range("A2") = ""
End If
End With
End Sub

Next. This is the click event for the checkbox, so be
sure that its on the worksheet's code page...the sheet on
which you have the checkbox...right click the sheet tab &
select view code

Finally, rather than moan about an error, tell us exactly
what the error is and on which line. We are here to help,
and this isn't a difficult process that you're stuck on.

Please keep us posted with your progress

Patrrick Molloy
Microsoft Excel MVP



-----Original Message-----
I have had four suggestions on how to make this work and

so far none will work. Now the True Statement has
something wrong.

Can anyone help?

Private Sub CheckBox1_Click()
With CheckBox1
If .Value = True Then
ActiveSheet.Range("A2").Value = _

Worksheets("Sheet2").Range("$B$4").Value
Else
If .Value = False Then
ActiveSheet.Range("A2") = ""
End If
End If
End With
End Sub

Thank You very much

.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Check Box Code Does Not Work


Patrick Molly,

Sorry your code does not work.

Boy did you get up on the wrong side of the bed. Or maybe you haven't
gone to bed Yet.

Thank you for trying,

Bob


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Check Box Code Does Not Work

Any time yo!
What were they talking about attitude?!?
I missed something... - Piku

--
Message posted from http://www.ExcelForum.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Check Box Code Does Not Work

pikus,

Again thanks for your help.
I have another problem you may be able to help with. Using the code
below I cannot figure out how to choose a range of cells. Private Sub
CheckBox2_Click()
With CheckBox2
If .Value = True Then
Worksheets(2).Cells(9, 1).Value = ActiveSheet.Cells(9,1).Value
Else
Worksheets(2).Cells(9, 1).Value = ""
End If
End With
End Sub

Another words how do I choose:
Worksheets(2).Cells(A9:D9).Value = This will not work.

I have also tried Range(Cells().

Thank you for your help.

Bob

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Check Box Code Does Not Work

Worksheets(2).Range("A9:D9").Value = _
Activesheet.Range("A9:D9").Value
Else
Worksheets(2).Range("A9:D9").ClearContents

--
Regards,
Tom Ogilvy

Bob Ciepiela wrote in message
...
pikus,

Again thanks for your help.
I have another problem you may be able to help with. Using the code
below I cannot figure out how to choose a range of cells. Private Sub
CheckBox2_Click()
With CheckBox2
If .Value = True Then
Worksheets(2).Cells(9, 1).Value = ActiveSheet.Cells(9,1).Value
Else
Worksheets(2).Cells(9, 1).Value = ""
End If
End With
End Sub

Another words how do I choose:
Worksheets(2).Cells(A9:D9).Value = This will not work.

I have also tried Range(Cells().

Thank you for your help.

Bob

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Check Box Code Does Not Work

It worked when I did it like this:

Private Sub CheckBox1_Click()
With CheckBox1
If .Value = True Then
ActiveSheet.Cells(2, 1).Value = Worksheets(2).Cells(4, 2).Value
ElseIf .Value = False Then
ActiveSheet.Range("A2") = ""
End If
End With
End Sub

- Pikus


---
Message posted from http://www.ExcelForum.com/

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Check Box Code Does Not Work


Pikus,

Thank you so much!!!

Works Great!!!!

Bob


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
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
Check Box Code Bob Excel Programming 3 January 14th 04 06:07 AM
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 03:51 PM.

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

About Us

"It's about Microsoft Excel"