David has attended:
Excel Advanced course
Excel Advanced course
Check Box Operation Linked to Cell
Hi,
How can I get a random cell to change from True to False on the operation of a check-box? I.e. if a check-box is ticked the cell will show "True"; if check-box is un-ticked the cell will show "False."
Many Thanks,
David
RE: Check Box Operation Linked to Cell
Hi David,
Thank you for your question.
If you go to View - Toolbars - Control Toolbox and then select the checkbox tool and draw a text box on your spreadsheet.
Once drawn, increase the length of the control to see the label and edit the label if necessary.
Right click over the checkbox and choose View Code. Make a note of the name of the checkbox by right clicking and Properties.
Copy and paste the following code between Private Sub CheckBox1_Click and End Sub:
If CheckBox1.Value = True Then
Range("a3") = "True"
Else
Range("a3") = "False"
End If
Close the Visual Basic window down and turn off design view to use the checkbox. On the control toolbox Design Mode is the first option.
I hope this answers your question.
Regards
Simon