Consulting

Results 1 to 5 of 5

Thread: Please! I need help re-arranging date format

  1. #1
    VBAX Regular
    Joined
    Aug 2006
    Posts
    18
    Location

    Please! I need help re-arranging date format

    I have a spreadsheet in excel 2003 with about 100 rows in column A. I need to rearrange the date format from yyyymmdd eg 20060902 to dd/mm/yyyy.
    Can someone help me with a macro to do this in bulk. I am ok to put the re-arranged dates in Column B. I can't figure it out! many thanks

  2. #2
    I did something very similar to this the other day but used formulae instead of a macro. I did it over 4 columns
    if the date was in cell A1, column B was day which had the formula =right(A1,2)
    Column C was month which was =mid(a1,5,2)
    Column D was year which was =left(a1,2)

    I then combined them all together in Column E with a formula as follows
    =E1 & "/" & F1 & "/" & G1.

    Once you have that formula it can be copied to each required cell and it should work it all out for you.

    HTH

    uksrogers

  3. #3
    VBAX Master Norie's Avatar
    Joined
    Jan 2005
    Location
    Stirling, Scotland
    Posts
    1,831
    Location
    No need for code.

    Select the column with the dates, goto Data>Text to columns... and select YMD on the last step.

    That should convert the values to 'real' dates which you can then format as required.

  4. #4
    Quote Originally Posted by Norie
    No need for code.

    Select the column with the dates, goto Data>Text to columns... and select YMD on the last step.

    That should convert the values to 'real' dates which you can then format as required.
    Nice.. had no idea you could use text to columns for that...

  5. #5
    VBAX Regular
    Joined
    Aug 2006
    Posts
    18
    Location

    RE:



    Thanks Gents !!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •