Hi,
Im trying to write a simple macro with a checkbox, so when i click a
checkbox a number is added to another number. So for example when i select a
checkbox i want the number 5 to be added to a number in another cell on my
spreadsheet.
Thankyou
Tom Ogilvy - 24 Jan 2006 14:22 GMT
Place a checkbox from the control toolbox toolbar
double click on the checkbox and it will take you to the Click event
Private Sub CheckBox1_Click()
End Sub
You can put your code here:
Private Sub CheckBox1_Click()
if not isnumeric(Range("A1").Value) then exit sub
if CheckBox1.Value = True then
Range("A1").Value = Range("A1").Value + 5
else
Range("A1").Value = Range("A1").Value - 5
end if
End Sub
Adjust the code to perform the functionality you actually require.
No go back to excel and in the control toolbox toolbar, make sure the button
in the upper left hand corner is not depressed (take you out of design
mode).

Signature
Regards,
Tom Ogilvy
> Hi,
>
[quoted text clipped - 4 lines]
>
> Thankyou
Kev - 24 Jan 2006 14:26 GMT
Try this
If CheckBox1.Value = True Then
Range("A1").Value = (Range("a1").Value + Range("a2").Value)
End If
First place a checkbox called checkbox1 in your sheet, double click on
the box and insert this snip of code. You can change the range values to
suit or change the range prior to the equals sign to place the result in
another cell.
Regards Kev
cjupiter - 25 Jan 2006 01:08 GMT
Thanks guys. Much helpful :)
> Hi,
>
[quoted text clipped - 4 lines]
>
> Thankyou