[VBA] Convert a String to Date

Solved
yacleouf Posted messages 461 Status Member -  
yacleouf Posted messages 461 Status Member -
Hello,

I suppose it's not something complicated, but I must admit I'm stuck...

Let me explain, I have a string input like "dec2013", "jan2013", etc...
and I would like to retrieve the date (first of the month) in the format DD/MM/YYYY.
I tried format(myDate, "DD/MM/YYYY"), but it didn’t work... when I hover over it, the string still contains a string...

I hope I've been clear? :-)

Configuration: VGN-cs21S, Windows 7 Professional 64bits

--
Google is your friend!

5 answers

  1. PHILOU10120 Posted messages 6463 Registration date   Status Contributor Last intervention   835
     
    Hello

    With a formula

    In A4 the information to be processed "janv2013" or "déc2013"

    =CNUM(LEFT(A4,3)&"/"&RIGHT(A4,4)) format the cell dd/mm/yyyy

    It is by forging that one becomes a blacksmith. - It is at the foot of the wall that one sees the mason - one always learns from their mistakes.
    0