Results 1 to 11 of 11

Find and replace recorded macro messes up the dates

Threaded View

  1. #1
    Forum Contributor
    Join Date
    01-29-2011
    Location
    Bristol, England
    MS-Off Ver
    Excel 2003
    Posts
    471

    Find and replace recorded macro messes up the dates

    What I need to achieve is to convert the info in column U which contains dates that are saved as text in format xx.xx.xxxx to change them into dates format dd/mm/yyyy (recognised as dates, not as text). You can do find "." and then replace "/" which does the trick. But as soon as I do the same thing with recorded macro it messes up some of the dates as they are still kept as text. It changes the "." with "/" on all cells but some of them are picked up by excel as dates others remain as text. You can really easily tell which one it recognizes as text and which as dates as text is kept aligned left, dates are aligned to right. To make things even more awkward the ones it picks up as date it swaps the dd and mm. If before its 09.03.2011 then after its 03.09.2011. Even when you change the format to dd/mm/yyyy the date remains the same 09.03.2011. If you do the process manually then problems excest. Please help with better solution.

    Here is my rubbish recorded macro.
    Sub test()
    'statDelDte column from text xx.xx.xxxx to dd/mm/yyyy
        Columns("U:U").Select
        Selection.Replace What:=".", Replacement:="/", LookAt:=xlPart, _
            SearchOrder:=xlByRows, MatchCase:=True, SearchFormat:=False, _
            ReplaceFormat:=False
    End Sub
    I will attach the xls as well.



    Some other solution than then recorded macro I have is needed.
    Please help
    Attached Files Attached Files
    Last edited by rain4u; 02-19-2011 at 09:22 AM. Reason: Mistake with SOLVED perfix

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1