View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
AltaEgo AltaEgo is offline
external usenet poster
 
Posts: 245
Default manual and macro run differences

Are you trying to change the format of something already recorded as a date?
If so, find and replace is not the way to achieve the desired result. You
need to format your date field according to you preferences.

In the worksheet, refer to the Text() function. In VBA see the Format()
function.

--
Steve

wrote in message
...
Columns("A:A").Select
Selection.Replace What:="2009", Replacement:="09", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

When I do it manually above replacement I received good results
(Text to date conversion)
But when record and run as macro I received comical result.
I really wonder why ? Any idea why this happens ? Thank you.