Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Any time yo!
What were they talking about attitude?!? I missed something... - Piku -- Message posted from http://www.ExcelForum.com |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
Display Modes | |
|
|
![]() |
||||
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) | |||
Check Box Code | Excel Programming | |||
Check my code to use template? | Excel Programming |