The VBA TIME Function

Related Function:
VBA DATE function

Description

The VBA Date Function simply returns the current time. The function takes no parameters and therefore, its format is:

Time( )

VBA Time Function Example

A simple example of the VBA Time function is shown below:

Dim CurrTime As Date
CurrTime = Time()

After running the above snippet of VBA code, the variable 'CurrTime' is set to the current time (note that in VBA, times are stored as a part of the 'Date' data type).

Return to the VBA Operators & Functions Page

Return to the Excel VBA Tutorial Page

Valid XHTML 1.0 Transitional Valid CSS!
Disclaimer   Privacy Policy
Copyright © 2008-2013 ExcelFunctions.net