ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Checkbox (https://www.excelbanter.com/excel-programming/326569-re-checkbox.html)

susan hayes

Checkbox
 
Hello

I would like to perform the following 2 tasks when someone clicks on the checkbox featu

First is enter the word "Market" in cell G9 and
Secondly to take whatever number appears in cell G16 and have it appear in cell B9, if the check
box is not selected then to leave blank both cells G9 and B9.

I tried the following but it does not work:

Private Sub Checkbox1_Clicks()
If CheckBox1.Value = True Then Range("B9").Value = Range("G16").Value and Range("G9") = "Market"
Else:
Range("B9").Value = ""
Range("G9") = ""
End Sub

Your help would be appreciated

Jen T.


Jim Cone

Checkbox
 
Susan/Jen T.

This is working for me, maybe it does what you want...
'----------------------------------------------------------
Private Sub CheckBox1_Click()
If CheckBox1.Value = True Then
Range("B9").Value = Range("G16").Value
Range("G9") = "Market"
Else
Range("B9").Value = ""
Range("G9") = ""
End If
End Sub
'----------------------------------------------------------

Regards,
Jim Cone
San Francisco, USA


"Susan Hayes" wrote in message ...
Hello

I would like to perform the following 2 tasks when someone clicks on the checkbox featu
First is enter the word "Market" in cell G9 and
Secondly to take whatever number appears in cell G16 and have it appear in cell B9, if the check
box is not selected then to leave blank both cells G9 and B9.
I tried the following but it does not work:


Private Sub Checkbox1_Clicks()
If CheckBox1.Value = True Then Range("B9").Value = _
Range("G16").Value and Range("G9") = "Market"
Else:
Range("B9").Value = ""
Range("G9") = ""
End Sub

Your help would be appreciated

Jen T.




All times are GMT +1. The time now is 12:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com