ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   A stopwatch to record time in a cell (https://www.excelbanter.com/excel-programming/308681-stopwatch-record-time-cell.html)

Gabe

A stopwatch to record time in a cell
 
Hi,

I'm new to programming in excel, actually this is the first time.
What I'm trying to do is have a worksheet capture the time of a task.
I've been able to creat a stopwatch in excel using the following:

Option Explicit

Private startTime As Single

Private Sub StartButton_Click()
startTime = Timer
End Sub

Private Sub StopButton_Click()
Dim finalTime As Single
finalTime = Timer - startTime
MsgBox Format(finalTime, "0.00")
End Sub

What I want to have is this stopwatch on the worksheet, but to record
the time in a cell and then move down to the next cell after
resetting. I may not need the stopwatch, but can use the Now() and
subtract the times. Can anyone point me in the right direction to do
this or possible help me get started?

Thank you in advance for your assistance.

GJones

A stopwatch to record time in a cell
 
Hi Gabe;

You can use;

activecell = Format(finalTime, "0.00")

or

Range("D1") = Format(finalTime, "0.00")
Thanks,

Greg
-----Original Message-----
Hi,

I'm new to programming in excel, actually this is the

first time.
What I'm trying to do is have a worksheet capture the

time of a task.
I've been able to creat a stopwatch in excel using the

following:

Option Explicit

Private startTime As Single

Private Sub StartButton_Click()
startTime = Timer
End Sub

Private Sub StopButton_Click()
Dim finalTime As Single
finalTime = Timer - startTime
MsgBox Format(finalTime, "0.00")
End Sub

What I want to have is this stopwatch on the worksheet,

but to record
the time in a cell and then move down to the next cell

after
resetting. I may not need the stopwatch, but can use the

Now() and
subtract the times. Can anyone point me in the right

direction to do
this or possible help me get started?

Thank you in advance for your assistance.
.


Gabe Valdez

A stopwatch to record time in a cell
 




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Gabe Valdez

A stopwatch to record time in a cell
 


Thank you. How or where would I put this into what I alrady have?


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


All times are GMT +1. The time now is 08:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com