Show Buttons
Share On Facebook
Share On Twitter
Share On Google Plus
Share On Linkdin
Share On Reddit
Contact us
Hide Buttons

VBA-Excel: Date-Time Functions – DateValue()

Description:

The Dat­e­Value() func­tion con­verts string to a date and return it.

For­mat:

DateValue(strString)

Arguments:
    • strString
      • Manda­tory
      • Type: String
      • String that needs to con­vert into date, if year is not pro­vided then it will take the cur­rent year by default.

Exam­ple:

Function FnDateValue()

  Dim strDate1

  Dim strDate2

 strDate1 = "10-July-2000"

    strDate2 = "12-June"    

  MsgBox "Date Value of 10-July-2000 is " & DateValue(strDate1) & vbCrLf & "Date Value of 12-June is " & DateValue(strDate2)

End Function
DateValue()

Dat­e­Value()

 

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: