ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   how do i change the value of a cell with a checkbox (https://www.excelbanter.com/excel-worksheet-functions/119891-how-do-i-change-value-cell-checkbox.html)

Rollie13

how do i change the value of a cell with a checkbox
 
I'm trying to have a cell value changed on the click of a checkbox. The total
value of the cell must change according to the checkbox selected. It's for an
automated expense account sheet which calculate the amount of mileage done in
a month and a grand total of the entire year along with monthly reimbursement.

Tx for any help

Corey

how do i change the value of a cell with a checkbox
 
Private Sub CheckBox1_Click()
If Range("A1").Value = True Then ' <=== Linked Cell for Check box (Check Box
Properties)
Range("B1").Value = "100" '<======== Cell(B1) is the cell value you want to
modify depending on check box result
Else
Range("B1").Value = "200"
End If
End Sub

Corey....
"Rollie13" wrote in message
...
I'm trying to have a cell value changed on the click of a checkbox. The
total
value of the cell must change according to the checkbox selected. It's for
an
automated expense account sheet which calculate the amount of mileage done
in
a month and a grand total of the entire year along with monthly
reimbursement.

Tx for any help




Vaughan

how do i change the value of a cell with a checkbox
 
In design view, open the properties sheet for the check box. Enter a cell
reference in the LinkedCell property. This cell will be True if the check box
is ticked and false if it isn't. You can then test the cell in your formula.

"Corey" wrote:

Private Sub CheckBox1_Click()
If Range("A1").Value = True Then ' <=== Linked Cell for Check box (Check Box
Properties)
Range("B1").Value = "100" '<======== Cell(B1) is the cell value you want to
modify depending on check box result
Else
Range("B1").Value = "200"
End If
End Sub

Corey....
"Rollie13" wrote in message
...
I'm trying to have a cell value changed on the click of a checkbox. The
total
value of the cell must change according to the checkbox selected. It's for
an
automated expense account sheet which calculate the amount of mileage done
in
a month and a grand total of the entire year along with monthly
reimbursement.

Tx for any help





Rollie13

how do i change the value of a cell with a checkbox
 
Tx u 2 for the prompt answer.
I tested it and it worked great.
Tx again

"Vaughan" wrote:

In design view, open the properties sheet for the check box. Enter a cell
reference in the LinkedCell property. This cell will be True if the check box
is ticked and false if it isn't. You can then test the cell in your formula.

"Corey" wrote:

Private Sub CheckBox1_Click()
If Range("A1").Value = True Then ' <=== Linked Cell for Check box (Check Box
Properties)
Range("B1").Value = "100" '<======== Cell(B1) is the cell value you want to
modify depending on check box result
Else
Range("B1").Value = "200"
End If
End Sub

Corey....
"Rollie13" wrote in message
...
I'm trying to have a cell value changed on the click of a checkbox. The
total
value of the cell must change according to the checkbox selected. It's for
an
automated expense account sheet which calculate the amount of mileage done
in
a month and a grand total of the entire year along with monthly
reimbursement.

Tx for any help






All times are GMT +1. The time now is 02:12 AM.

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