fjkilken
asked on
Code to create race timer in Excel
HI
I want to add a button into an Excel sheet to perform basic timing for multiple competitors in a race.
Basically, all the button needs to do is enter the current time (ideally down to 10ths or 100ths of a second) in a cell, and then move down to the next cell below, and enter the next time in that cell when the button (or Enter key) is pressed again
Thanks a lot!
Fergal
I want to add a button into an Excel sheet to perform basic timing for multiple competitors in a race.
Basically, all the button needs to do is enter the current time (ideally down to 10ths or 100ths of a second) in a cell, and then move down to the next cell below, and enter the next time in that cell when the button (or Enter key) is pressed again
Thanks a lot!
Fergal
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Try this excel logging stopwatch http://www.xnotestopwatch.com
ASKER
thanks!
Option Explicit
Private StartTime As Double
Public Sub InsertTime()
If StartTime = 0 Then
StartTime = Timer
Else
ActiveCell = (Timer - StartTime) / 24 / 60 / 60
ActiveCell.Offset(1, 0).Select
End If
End Sub
See the attached workbook.
The first click of the button starts the timer. Each subsequent click records the time at the click in the active cell and moves the selection down one cell.
Kevin
Q-26990141.xls