Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Is there a way to have a timer or stopwatch function in Excel.


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,090
Default Is there a way to have a timer or stopwatch function in Excel.

Tell us what you want to do. HTH Otto
"JSenew" wrote in message
...



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Is there a way to have a timer or stopwatch function in Excel.

Wishing to help a friend of mine that runs mtn. bike races. He does in
manually, I was wondering if I could use Excel. The dream would be I 'start'
the timer, then as a racer crosses the finish line, I type in their bib
number and hit enter. Time is recorded for that bib number. When the next
racer finishes, I type in that bib number and hit enter. That time is
recorded for that bib number.

Thanks in advance for you help.


"Otto Moehrbach" wrote:

Tell us what you want to do. HTH Otto
"JSenew" wrote in message
...




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,081
Default Is there a way to have a timer or stopwatch function in Excel.

Here's some great code for a precise timer.


Private Declare Function getFrequency Lib "kernel32" Alias _
"QueryPerformanceFrequency" (cyFrequency As Currency) As Long
Private Declare Function getTickCount Lib "kernel32" Alias _
"QueryPerformanceCounter" (cyTickCount As Currency) As Long

Public dblStart As Double
Public dblEnd As Double


Function MicroTimer() As Double
' COPYRIGHT © DECISION MODELS LIMITED 2000. All rights reserved
' returns a Double containing seconds
' uses Windows API calls to the high resolution timer

Dim cyTicks1 As Currency
Static cyFrequency As Currency

MicroTimer = 0
' get frequency
If cyFrequency = 0 Then getFrequency cyFrequency

' get ticks
getTickCount cyTicks1

' calc seconds
If cyFrequency Then MicroTimer = cyTicks1 / cyFrequency

End Function

-----------------
In your code declare a couple of vars that are doubles

Public dblStart As Double
Public dblEnd As Double

'record the start time
dblStart = MicroTimer()

' do some stuff here

' record the end time
dblEnd = MicroTimer()

' calc the elapsed time & put in the range named "Elapsed"
Range("elapsed) = dblEnd - dblStart

"Otto Moehrbach" wrote:

Tell us what you want to do. HTH Otto
"JSenew" wrote in message
...




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
Starting a stopwatch on Excel???!?!?! Paul23 Excel Discussion (Misc queries) 2 June 10th 10 09:20 PM
Is it possible to place a stopwatch in Excel Kari Excel Worksheet Functions 2 June 10th 10 09:16 PM
template timer stopwatch wamay Excel Worksheet Functions 1 April 15th 06 10:24 PM
Stopping a Timer / Running a timer simultaneously on Excel Paul23 Excel Discussion (Misc queries) 1 March 10th 06 12:08 PM
Timer function needs improvement Mike K Excel Worksheet Functions 0 July 17th 05 05:35 AM


All times are GMT +1. The time now is 02:37 PM.

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"