Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I write a macro for keeping time?
I would like to write a macro that will work in Excel 2003 that would enable
a user to use keys on the keyboard (F5 and F6 for example) to start and stop a timer function and return the amout of time elapsed between keystrokes...like a stop watch. I would like to use this to track machine downtime. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I write a macro for keeping time?
Private nTime As Double
Public Sub SetKeys() Application.OnKey "{F5}", "StartTimer" Application.OnKey "{F6}", "StopTimer" End Sub Public Sub StartTimer() nTime = Timer End Sub Public Sub StopTimer() MsgBox Timer - nTime & "secs" End Sub -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "TomK76" wrote in message ... I would like to write a macro that will work in Excel 2003 that would enable a user to use keys on the keyboard (F5 and F6 for example) to start and stop a timer function and return the amout of time elapsed between keystrokes...like a stop watch. I would like to use this to track machine downtime. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Time Keeping | New Users to Excel | |||
is it possible to execute write to the fields in another .xsl form a macro in another .xsl? e.g. some way to load another .xsl into an .xsl macro and write to its data? | Excel Worksheet Functions | |||
How to write a macro to get the system time in excel 97 | Excel Discussion (Misc queries) | |||
time keeping | Excel Programming | |||
Write a macro ro copy column at certain time of day. | Excel Programming |