Click to add points in Excel

Microsoft Excel 2007
July 24, 2009 at 06:32:19
Specs: Windows XP Pro
I am using Excel 2007 and would like to add a button that when clicked will add a numeric value of 1 in a seperate field. The idea is if my kids are good, we can click the button to add a point and another button to subtract a point. Please help.

See More: Click to add points in Excel

Report •

July 26, 2009 at 18:33:42
Although the thought of disciplining a child with an Excel spreadsheet is somewhat disturbing, at least to me, these 2 pieces of code will add or subtract 1 from whatever is in A1.

Sub GoodKid()
 Range("A1") = Range("A1") + 1
End Sub

Sub BadKid()
 Range("A1") = Range("A1") - 1
End Sub

Right click a sheet tab, choose view code and paste this code into the window that opens.

You can then insert any picture, shape or clip art into your sheet and then right click it and choose Assign Macro. Assign one of these two macros to each button and you're done.

How about of picture of your kid laughing for the GoodKid macro and one of the kid crying for the BadKid code? That shouldn't leave any permanent scars.

Report •
Related Solutions

Ask Question