none
Numbers to Date RRS feed

  • Question

  • I want to change three variables into a valid date. For example Yr=2014 : Mo=9: Da=26 to result in TheDate="2014/09/26".

    Very elementary but I do not know how.  What happened to the old help?

    Monday, February 16, 2015 2:34 PM

Answers

  • Re: variables to a date

    Returns a Variant (date)...   DateSerial(year, month, day)
    '---

    Jim Cone
    Portland, Oregon USA
    https://goo.gl/IUQUN2 (Dropbox)
    (free & commercial excel add-ins & workbooks)

    • Proposed as answer by L.HlModerator Tuesday, February 17, 2015 4:45 AM
    • Unproposed as answer by L.HlModerator Tuesday, February 17, 2015 9:43 AM
    • Marked as answer by L.HlModerator Wednesday, February 25, 2015 2:55 AM
    • Edited by James Cone Monday, October 31, 2016 6:07 PM
    Monday, February 16, 2015 3:18 PM
  • Hi,

    >> I want to change three variables into a valid date. For example Yr=2014 : Mo=9: Da=26 to result in TheDate="2014/09/26

    DateSerial Function could return a variant for a year,month,day.

    DateSerial ( year, month, day )

    By the way, this forum is for discussing questions about Excel development. For pure VBA questions, I suggest you posting them on VBA forum. Thanks for your understanding.

    Best Regards.

    Lan


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by L.HlModerator Wednesday, February 25, 2015 2:55 AM
    Monday, February 23, 2015 1:26 AM
    Moderator

All replies

  • Re: variables to a date

    Returns a Variant (date)...   DateSerial(year, month, day)
    '---

    Jim Cone
    Portland, Oregon USA
    https://goo.gl/IUQUN2 (Dropbox)
    (free & commercial excel add-ins & workbooks)

    • Proposed as answer by L.HlModerator Tuesday, February 17, 2015 4:45 AM
    • Unproposed as answer by L.HlModerator Tuesday, February 17, 2015 9:43 AM
    • Marked as answer by L.HlModerator Wednesday, February 25, 2015 2:55 AM
    • Edited by James Cone Monday, October 31, 2016 6:07 PM
    Monday, February 16, 2015 3:18 PM
  • Hi,

    >> I want to change three variables into a valid date. For example Yr=2014 : Mo=9: Da=26 to result in TheDate="2014/09/26

    DateSerial Function could return a variant for a year,month,day.

    DateSerial ( year, month, day )

    By the way, this forum is for discussing questions about Excel development. For pure VBA questions, I suggest you posting them on VBA forum. Thanks for your understanding.

    Best Regards.

    Lan


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by L.HlModerator Wednesday, February 25, 2015 2:55 AM
    Monday, February 23, 2015 1:26 AM
    Moderator