Excel Macro Timer - Easy to Use

Add to Favorites
Author: | Edits: don

Simple but precise macro timer code that allows you to speed test any macro or part of a macro and then record the results so that you can compare them and tweak your macros to run faster and better.

The code that I show you here is simple, fast, and easy to use, you just copy/paste it where you need it and comment it out when you are finished or remove it.

The snippets provided below are explained in detail in the video above.

Timer Start

Paste this into your macro where the timer should begin.

    ' Timer Start
    ' https://www.TeachExcel.com
    ' - Type Ctrl + G to see the Immediate Window, where the result of this
    '   will be output. (View > Immediate Window)
    Dim timerStart As Double
    timerStart = Timer

Timer End and Output

Paste this into your macro where the timer should end and the output generated.

This outputs to the Immediate Window (Ctrl + G | View > Immediate Window)

    ' Timer End
    ' https://www.TeachExcel.com
    Debug.Print vbNewLine & String(40, "*") & vbNewLine & _
                "Timer: " & Timer - timerStart & _
                vbNewLine & String(40, "*") & vbNewLine

Downloadable Files: Excel File

Question? Ask it in our Excel Forum


Our Excel Courses

  • Skill Level: All Levels
  • |
  • 5 hours+

How to make a fully featured professional form in Excel that is unbreakable. This includes how to use the form to store, view, edit, and delete data from a data storage worksheet.

  • Skill Level: All Levels
  • |
  • 2 hours

Send Emails from Excel using VBA and Macros. This course starts from the Basics and builds up to more advanced examples with attaching workbooks, worksheets, PDF's, automatically sending emails, including a signature, error handling, increasing speed, and more.