Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
manual and macro run differences
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
manual and macro run differences
On May 7, 9:52*am, "AltaEgo" <Somewhere@NotHere wrote:
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.- Hide quoted text - - Show quoted text - Hi Steve, thank you for your reply. I copy a word table into excel as text but date field doesnt't work. So when I manually change 2009 to 09 whole column becomes proper date. I recorded the replacement into a macro and run but the result is different than manual replacement. If only i managed to run some word vba codes through excel like replacement as i have to do some other replacements after copying the table. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
manual and macro run differences
To convert your text dates to proper dates, use the Datevalue() function
If you have a text date in A1: =Datevalue(A1) You will see a number in the cell in which you entered the above formula. to change this to a date, Format the cell and choose your date formula. To get this back into A1 in place of the original value, copy, paste special, value. -- Steve wrote in message ... On May 7, 9:52 am, "AltaEgo" <Somewhere@NotHere wrote: 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.- Hide quoted text - - Show quoted text - Hi Steve, thank you for your reply. I copy a word table into excel as text but date field doesnt't work. So when I manually change 2009 to 09 whole column becomes proper date. I recorded the replacement into a macro and run but the result is different than manual replacement. If only i managed to run some word vba codes through excel like replacement as i have to do some other replacements after copying the table. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Differences in Excel macro recording from 2003 to 2007! Help! | Excel Programming | |||
Macro with manual file selection? | Excel Programming | |||
Macro resets my calculation to manual | Excel Programming | |||
Manual Input During Macro Execution | Excel Programming | |||
Macro vs Manual save event | Excel Programming |