Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default Just curious about Excel copying dates between workbooks???

Excel 2K, Windows XP. I know Excel stores dates as numbers.

I use code to copy data from a .csv sheet. The data normally include a
column of text in dd/mm/yyy format. Normally, I convert this to numeric/date
format after it is copied in.

While developing, I am not refreshing the .csv file. Instead, I decided to
open it and age the data by a few days. To age it I converted the .csv to a
date then added (say) five days. The column of dates were formatted
"dd/mm/yyyy" to ensure they 'aged' correctly. Result - all looks as it
should in the .csv sheet.

Back to the original sheet. Click the button to run the copy data in macro.
Data copies. However, all dates were 'confused' by the process. For example,
instead of seeing 08/11/2005, the date is copied in as 11/08/2005 (ie
approximately 3 months incorrect).

This is not causing me a problem. The workaround is to open the .csv sheet
and format column A as a number, the correct value now copies in. However, I
am curious why the values are incorrect when Excel is working with numbers
in dd/mm/yyyy format between workbooks.

Steve




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Just curious about Excel copying dates between workbooks???

in most cases, vba interprets date like strings as if they were in US
sequence. If you work with date serial numbers rather than strings, you
will not have a problem.

--
Regards,
Tom Ogilvy


"Steve" <No Spam wrote in message ...
Excel 2K, Windows XP. I know Excel stores dates as numbers.

I use code to copy data from a .csv sheet. The data normally include a
column of text in dd/mm/yyy format. Normally, I convert this to

numeric/date
format after it is copied in.

While developing, I am not refreshing the .csv file. Instead, I decided to
open it and age the data by a few days. To age it I converted the .csv to

a
date then added (say) five days. The column of dates were formatted
"dd/mm/yyyy" to ensure they 'aged' correctly. Result - all looks as it
should in the .csv sheet.

Back to the original sheet. Click the button to run the copy data in

macro.
Data copies. However, all dates were 'confused' by the process. For

example,
instead of seeing 08/11/2005, the date is copied in as 11/08/2005 (ie
approximately 3 months incorrect).

This is not causing me a problem. The workaround is to open the .csv sheet
and format column A as a number, the correct value now copies in. However,

I
am curious why the values are incorrect when Excel is working with numbers
in dd/mm/yyyy format between workbooks.

Steve






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
PROBLESM IN COPYING BETWEEN WORKBOOKS AFTER EXCEL 2003 UPGRADE JVorch Excel Discussion (Misc queries) 3 October 27th 08 05:30 PM
Access to Excel 2007 curious behavior artificial Excel Discussion (Misc queries) 0 February 6th 07 05:41 PM
Why does the font change when copying between Excel workbooks Paul Newbery CSC Excel Discussion (Misc queries) 1 September 16th 05 04:30 PM
Dates Format changing when copying data between workbooks [email protected] Excel Programming 2 May 19th 05 06:31 AM
Copying blank excel worksheet into additional excel workbooks Deb Excel Discussion (Misc queries) 10 February 4th 05 12:25 AM


All times are GMT +1. The time now is 02:43 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"