ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Applying a change based on a CheckBox (https://www.excelbanter.com/excel-programming/335976-applying-change-based-checkbox.html)

Patrick Simonds

Applying a change based on a CheckBox
 
Currently I use the following code to populate a cell on my worksheet from a
TextBox on a DialogBox:

Private Sub CommandButton1_Click()

Dim rng
Set rng = Cells(ActiveCell.Row, 1)
rng(1, 1).Value = TextBox3.Text

End Sub

Also on that DialogBox is a CheckBox. What I would like to have happen is,
if the CheckBox is selected (checked) then an X would be placed in cell 3 of
the current row "rng(1, 3)".




Henry[_5_]

Applying a change based on a CheckBox
 
Patrick,

Before the End Sub line:

If Checkbox1.Value = True then rng(1,3).value = "X"

Henry


"Patrick Simonds" wrote in message
...
Currently I use the following code to populate a cell on my worksheet from
a TextBox on a DialogBox:

Private Sub CommandButton1_Click()

Dim rng
Set rng = Cells(ActiveCell.Row, 1)
rng(1, 1).Value = TextBox3.Text

End Sub

Also on that DialogBox is a CheckBox. What I would like to have happen is,
if the CheckBox is selected (checked) then an X would be placed in cell 3
of the current row "rng(1, 3)".







All times are GMT +1. The time now is 09:34 AM.

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