Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Counter button
How would I go about coding a command button to advance a number in another
cell by 1 each time the button is clicked, like a counter? |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Counter button
'View' 'Toolbars' 'Forms'
In the box that appears, click 'Button' (second down on the right) then click in the worksheet. In the box that appears click 'New' Underneath 'Sub Botton1_Click' enter:- Range("A1") = Range("A1") + 1 Press Alt and F11 to close the window. Change A1 to suit and you can rename the button by right clicking it. Regards, Alan. "Dennis" wrote in message ... How would I go about coding a command button to advance a number in another cell by 1 each time the button is clicked, like a counter? |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Counter button
Dennis,
After creating you command button assign this code. You might also consider doing some error checking because it the cell contains text adding 1 will give an error. Sub Button1_Click() Range("A1").Value = Range("A1").Value + 1 End Sub Mike "Dennis" wrote: How would I go about coding a command button to advance a number in another cell by 1 each time the button is clicked, like a counter? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Day counter | Excel Discussion (Misc queries) | |||
How do i set up a counter? | Excel Discussion (Misc queries) | |||
1+2+3+4+........... Counter | Excel Discussion (Misc queries) | |||
Add A Day Counter | Excel Discussion (Misc queries) | |||
counter | Excel Discussion (Misc queries) |