Time a button is clicked


Posted by Paul Magruder on March 07, 2001 12:15 PM


Is There code that will record the Time a button is clicked on a userform? I need to track the amount of time used for a production run. The operator pushes one button to start the order, and another when the order is finished (other data is entered into a database). If I use "Now()" the time changes anytime the enter key is pushed. There is only 1 or 2 min between start and finish
Excel 97....Thanks ...Paul Magruder

Posted by ml on March 07, 2001 2:00 PM

you could map the button to a macro that places
the value of Now into a cell
ex:
Sub Start_Click()
Sheets("Timetrack").Range("A1").Value = Now
End Sub
Sub End_Click()
Sheets("Timetrack").Range("B1").Value = Now
End Sub
The code could be enhanced to place the timestamps in the
first blank cell in a column.



Posted by Paul Magruder on March 07, 2001 7:50 PM

Thanks.... Just what I needed

Thanks...Its just what I needed.

Paul