VBA TimeValue function

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

TimeValue Function Description

The VBA TimeValue function returns the date variable for a string representing time.

Syntax

The syntax for the TimeValue function in VBA is:

TimeValue( time )

Parameters

time
A string representing time e.g. “20:10”, “08:10 PM”

Example usage

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

TimeValue "20:10"
'Result: 20:10:00 

TimeValue "09:20 PM"
'Result: 21:20:00 

Simply the best place to learn Excel VBA