TimeValue function

Category: Date & Time

Summary

String to time.

Syntax

Returns a Variant (Date) containing the time.

Example

Remarks
You can enter valid times by using a 12-hour or 24-hour clock. For example, "2:24PM" and "14:24" are both valid time arguments.

If the time argument contains date information, TimeValue doesn't return it. However, if time includes invalid date information, an error occurs.

Microsoft Support Page

https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/timevalue-function

Back to Functions