Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
A Simple Timer
I have a Worksheet_Change event that does different things depending
on which column is involved. I would like to set the current time somewhere when I start entering data and again when I finish. Entering 'End' triggers a sort routine. I just need to know the time interval between starting and ending entries. I know I could look at a clock both times, but that's not as much fun. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
A Simple Timer
Jay,
Try something like Private Declare Function GetTickCount Lib "kernel32" () As Long Private Sub Worksheet_Change(ByVal Target As Range) Dim StartTick As Long Dim EndTick As Long StartTick = GetTickCount() ' ' your code here ' EndTick = GetTickCount() MsgBox "Elapsed time (milliseconds): " & _ Format(EndTick - StartTick, "#,##0") End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Jay Fincannon" wrote in message ... I have a Worksheet_Change event that does different things depending on which column is involved. I would like to set the current time somewhere when I start entering data and again when I finish. Entering 'End' triggers a sort routine. I just need to know the time interval between starting and ending entries. I know I could look at a clock both times, but that's not as much fun. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
A Simple Timer
That's exactamundo. How would I ever know about Lib "kernel32"() ?
On Thu, 20 Nov 2003 08:13:42 -0600, "Chip Pearson" wrote: Jay, Try something like Private Declare Function GetTickCount Lib "kernel32" () As Long Private Sub Worksheet_Change(ByVal Target As Range) Dim StartTick As Long Dim EndTick As Long StartTick = GetTickCount() ' ' your code here ' EndTick = GetTickCount() MsgBox "Elapsed time (milliseconds): " & _ Format(EndTick - StartTick, "#,##0") End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Are there any Excel macros for a simple countdown timer? | Excel Discussion (Misc queries) | |||
Timer | Excel Worksheet Functions | |||
Stopping a Timer / Running a timer simultaneously on Excel | Excel Discussion (Misc queries) | |||
Timer | Excel Programming | |||
Timer | Excel Programming |