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 – CDate()

Description: 

The CDate() func­tion con­verts a valid date and time expres­sion to Type Date

Format:

CDate(date)

Arguments:
  • date
    • Manda­tory
    • The expres­sion will be con­verted into Type Date


Exam­ple:

Function FnCDate()
 Dim strDate
 Dim intDate
 Dim strTime

  strDate = "June 24, 2013"    

    intDate = #12/6/1985#    

    strTime = "15:30:15 PM"

    MsgBox CDate(strDate)    

    MsgBox CDate(intDate)    

    MsgBox CDate(strTime)

End Function
Cdate()

Cdate()

 

You may also like...

Leave a Reply

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

%d bloggers like this: