Code to create race timer in Excel

Posted on 2011-05-02
Last Modified: 2012-05-11
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!

Question by:fjkilken
    LVL 81

    Expert Comment

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

    Option Explicit

    Private StartTime As Double

    Public Sub InsertTime()

        If StartTime = 0 Then
            StartTime = Timer
            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.

    LVL 81

    Accepted Solution

    A revision. A message added with instructions. A few more features.

    LVL 3

    Expert Comment

    Try this excel logging stopwatch

    Author Closing Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
    Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
    The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
    This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

    760 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

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now