locked
Convert '14 May 2017' into Date var RRS feed

  • Question

  • Please propose a way to convert the text sting '14 May 2017' to a date variable in Excel VBA.
    Friday, May 19, 2017 10:39 AM

All replies

  • Both CDate and the DateValue function should do this. For example:

    Dim strText As String
    Dim dtmDate As Date
    strText = "14 May 2017"
    dtmDate = CDate(strText)


    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    Friday, May 19, 2017 11:46 AM