Inserting right format for a date

  • Hello everyone,


    Does anybody have an idea for VBA code for the following problem:


    I am working with another system that for some reason leaves out the dash between the year, month and day, this of course causes some problems when I want to do some date calculations. So if the date is for example:
    20060116 how can I convert this to 2006-01-16 by VBA?


    Robert

    .¸¸·´¯'·.¸¸.·´¯'·.¸¸·´¯'·.¸¸.·´¯'·.¸¸·´¯'·.¸¸.· ><((((º>

  • Re: Inserting right format for a date


    Robert


    Select the dates, goto Data>Text to Columns..., on the 3rd step select date for the column data format and YDM from the dropdown.


    That should convert them into 'real' dates.


    You could also use a formula.

    Boo!:yikes:

  • Re: Inserting right format for a date


    :thanx: :thanx:
    and thank u


    Robert

    .¸¸·´¯'·.¸¸.·´¯'·.¸¸·´¯'·.¸¸.·´¯'·.¸¸·´¯'·.¸¸.· ><((((º>

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!