Date changes when pasted into Excel

January 14, 2011 at 08:12:54
Specs: Windows XP
When copying and pasting from a .csv file into a worksheet with a macro, the date format changes from 04/01/2011 to 01/04/2011. This causes a sort problem.

Any help would be appreciated !


See More: Date changes when pasted into Excel

Report •

January 16, 2011 at 19:44:43
Date formats in MS Office are controlled by the settings in your Control Panel under Regional and Language Options.

Click the Customize button and then the Date tab. Set it however you want/need.

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.

Report •

January 17, 2011 at 00:54:21
Thanks for the reply !
I have checked the date format as suggested but this is in English(UK) as perviously set ! DD/MM/YYYY.
The original .csv file is compiled by a number of .txt files taken from our assembly machines (PLDD/MM/YYYY.txt) on a daily basis, these are read by a batch file ( Copy PL*.txt > PLMaser.csv) and sent to the PLMaser.csv.

When reading the PLMaser in Excel it is ok, But when copy and pasted to the spreadsheet by the Macro the DD and MM are reversed ??

Also when trying to Format the DD/MM/YYYY in the original .csv before copy & paste, this also gets corrupted !

This does seem to be the default Regional and Language Options as you suggest but checking the setting it looks ok ?

Head scratcher !!! Pp

Report •

Related Solutions

Ask Question