[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Code to create race timer in Excel

Posted on 2011-05-02
4
Medium Priority
?
1,328 Views
Last Modified: 2012-05-11
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
0
Comment
Question by:fjkilken
  • 2
4 Comments
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 35509749
I used this macro:

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
0
 
LVL 81

Accepted Solution

by:
zorvek (Kevin Jones) earned 2000 total points
ID: 35509772
A revision. A message added with instructions. A few more features.

Kevin
Q-26990141.xls
0
 
LVL 3

Expert Comment

by:dmitry_n
ID: 35510847
Try this excel logging stopwatch http://www.xnotestopwatch.com
0
 

Author Closing Comment

by:fjkilken
ID: 35511202
thanks!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question