LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro behaves differently then when recorded and stuffs dates (or date formats)


I recorded a macro to paste dates from a text file and the macro behaves
differently and gives different results then when I recorded it. The
macro stuffs up the dates which are pasted or stuffs up the date format
and I cannot fix the result.
The action is part of a larger macro, but I have attached a simplified
example which simulates the problem.
I have recorded the macro using macro record. While I record the result
is correct. However when I replay the macro the date returned can be
incorrect. Note my date format is d/mm/yy. The error only occurs for
dates with the day less than 13! (Something to do with the month range
1 to 12???)
eg: date copied is 1/11/05 the result is 11/1/2005, however the date
28/10/05 copies correctly. BUT I repeat the error does not occur during
live recording - it only occurs when playing the macro.
I have tested this on a second PC and it still occurs. I am using
English (Australia) for region. I tested English (US) and the error
still occurred.
I am interested to see if the same problem occurs for other users. You
could quickly try this example yourself.
I attach 2 files dates.txt and dates.xls Simply copy the dates in
dates.txt (to your clipboard), then within an excel file start
recording a macro, then simply paste the dates. Stop macro recording.
Now select another column and run the macro. Are the results the same?
They weren't for me!
dates.xls has a macro (macro1) already. It also shows the results I
got. All the macro does is
-ActiveSheet.Paste-
Cheers!


+-------------------------------------------------------------------+
|Filename: dates.zip |
|Download: http://www.excelforum.com/attachment.php?postid=4031 |
+-------------------------------------------------------------------+

--
stephenb
------------------------------------------------------------------------
stephenb's Profile: http://www.excelforum.com/member.php...o&userid=28726
View this thread: http://www.excelforum.com/showthread...hreadid=484187

 
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
How do I convert date/time formats differently? Ruidil Excel Discussion (Misc queries) 4 June 6th 09 08:22 PM
Formula behaves differently mtpsuresh Excel Worksheet Functions 4 May 22nd 06 12:14 PM
changing a recorded macro - date problem.... Daan Excel Programming 5 September 23rd 05 04:19 PM
RECORDED MACRO PASTE'S DATE DIFFERENTLY TO MANUAL PASTE Pauldecan Excel Worksheet Functions 0 June 23rd 05 05:45 PM
In excel the formula bar behaves differently on different machines vijay Excel Discussion (Misc queries) 0 May 20th 05 06:27 AM


All times are GMT +1. The time now is 03:33 AM.

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

About Us

"It's about Microsoft Excel"