VBA Timer Function

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)

The VBA Timer function returns a Single numeric value representing the number of seconds elapsed since midnight on the current day.

If you want to pause code execution for duration of time check out the VBA Sleep and Application.Wait functions instead.

VBA Timer Function Syntax

The syntax for the Timer function in VBA is:

The Timer function does not accept any parameters.

Example usage

The VBA Timer function can be used in VBA code. Let’s look at some VBA Timer function examples:

Measure elapsed time in Seconds

Measure elapsed time in Hours / Minutes / Seconds

As the VBA Timer function measures time elapsed in seconds, if we want minutes or hours instead we may need to tweak it:

Simply the best place to learn Excel VBA