
- VBA Tutorial
- VBA - Home
- VBA - Overview
- VBA - Excel Macros
- VBA - Excel Terms
- VBA - Macro Comments
- VBA - Message Box
- VBA - Input Box
- VBA - Variables
- VBA - Constants
- VBA - Operators
- VBA - Decisions
- VBA - Loops
- VBA - Strings
- VBA - Date and Time
- VBA - Arrays
- VBA - Functions
- VBA - Sub Procedure
- VBA - Events
- VBA - Error Handling
- VBA - Excel Objects
- VBA - Text Files
- VBA - Programming Charts
- VBA - Userforms
- VBA Useful Resources
- VBA - Quick Guide
- VBA - Useful Resources
- VBA - Discussion
VBA - Timer Function
The Timer Function returns the number of seconds and milliseconds since 12:00 AM.
Syntax
Timer()
Example
Add a button and add the following function.
Private Sub Constant_demo_Click() msgbox("Time is : " & Now()) msgbox("Timer is: " & Timer()) End Sub
When you execute the above function, it produces the following output.
Time is : 19/07/2013 3:45:53 PM Timer is: 56753.4
vba_date_time.htm
Advertisements