Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 245
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Differences in Excel macro recording from 2003 to 2007! Help! KjS Excel Programming 0 January 21st 09 09:02 PM
Macro with manual file selection? Pmedina Excel Programming 2 June 23rd 05 10:50 PM
Macro resets my calculation to manual Hari[_3_] Excel Programming 11 June 16th 04 03:59 AM
Manual Input During Macro Execution Sherlock[_2_] Excel Programming 5 April 27th 04 04:59 PM
Macro vs Manual save event David Sedberry Excel Programming 2 September 25th 03 06:05 PM


All times are GMT +1. The time now is 05:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"