Strange find and replace query



I use the code below to select a column of data and replace . with a /
so I can sort the data in chronological order (as a date). However,
this only works if I manually find and replace (with the find and
replace dialogue). If I use the macro below, the dates are sometimes
adjusted (day and month is switched). Also, when the data is then
sorted, it does not get sorted in chronological order (only when it is
done manually does the data sort correctly).

The original data is an extract from one of our work databases (which
I have no hope of amending).
Not sure if really the workbook needs to be viewed, but not sure how I
can post this to the group?
Any ideas?

Matt

Sub Change_To_Date_Format()

Dim C As Range
Dim EndCell As String

Range("J3").Select


EndCell = ActiveCell.End(xlDown).Address

Range("J3", EndCell).Select

Selection.Replace What:=".", Replacement:="/", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False,
_
ReplaceFormat:=False


End Sub
.



Relevant Pages

  • Re: sort
    ... Trying to re-arrange into chronological order] ... You sort that one-element list which effectivly doesn't do anything. ... Of course the net effect is ... And then move the sortand printcalls out of the bearbeiten function, ...
    (comp.lang.perl.misc)
  • Re: Can this VBA for work on text files be modified for a different job ?
    ... you'll need to start it by typing ... For the Option Explicit, in the VBE, use Tools | Options... ... As to your chronological order concern: you could address this either of two ... If the files are created in proper chronological order, then your could sort ...
    (microsoft.public.excel)
  • Re: Looking for an picture management program - ideas please.
    ... image directory indicating its date or it allows me to sort the ... me chronological order if sorted alphabetically. ... June Canal Holiday ...
    (Ubuntu)
  • Re: sorting in outlook express
    ... Enquire, plan and execute. ... Or you can use Edit | Find and search by From and specify a date range, or sort by date from the results. ... be in chronological order. ... sort by sender. ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: Strange find and replace query
    ... Try to format column J as Date and run the sub afterwards. ... so I can sort the data in chronological order. ... Dim EndCell As String ...
    (microsoft.public.excel.programming)

Loading