ExcelFunctions.net Logo

The VBA TIME Function

Home » Excel-VBA-Tutorial » VBA-Operators-And-Functions » VBA-Time-Function
Search this site:
Custom Search
Related Function: 

Description

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

Time()

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).





Valid XHTML 1.0 Transitional
Disclaimer Privacy Policy

Copyright © 2008-2011 ExcelFunctions.net