Share via


Visual Basic for Applications Reference

DateValue Function Example

This example uses the DateValue function to convert a string to a date. You can also use date literals to directly assign a date to a Variant or Date variable, for example, MyDate = #2/12/69#.

  Dim MyDate
MyDate = DateValue("February 12, 1969")   ' Return a date.