#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 202
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 492
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Day counter poohgld Excel Discussion (Misc queries) 2 October 2nd 08 10:45 AM
How do i set up a counter? Bulldog21 Excel Discussion (Misc queries) 2 July 23rd 08 02:12 PM
1+2+3+4+........... Counter 23Hitamn Excel Discussion (Misc queries) 3 August 28th 07 10:17 AM
Add A Day Counter EisPanzer Excel Discussion (Misc queries) 3 May 9th 07 01:24 AM
counter Haza Excel Discussion (Misc queries) 2 January 20th 06 08:30 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"