View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Copy/Paste dates from CSV file - date format error?

#1. Rename your .csv file to .txt
Then use File|Open to open that .txt file.

You'll be prompted with a text to columns wizard. You can choose the format for
each field--including date in the dmy order you want.

#2. Change your windows short date format (control panel|regional settings...)
to match your data and then try importing the .csv. Then change the windows
short date format back to what you want.

ps. Those dates that got imported as dates weren't the dates you wanted.

01/02/2007 would bring in January 2, 2007 (using my USA settings). With dmy, it
would be February 1, 2007. So don't trust the accuracy of those dates when
using the .csv file with different windows short date formats.)

"michael.beckinsale" wrote:

Hi All,

Using Excel 2003 & Windows XP, UK regional settings.

I am developing a solution that is very date dependent and requires a
csv file to be produced from an external source. Data from the csv
file is then copied & pasted into an Excel workbook. However it seems
that although the dates in the csv file are in UK format when they get
pasted into Excel they are in US format but only for days 1 to 12.

I seem to remember something from the dim & distance path that
Microsoft knew of this 'limitation'.

Can anybody

1) confirm this is a known error / limitation in XL2003
2) suggest a workaround
3) provide code for a workaround

All help gratefully appreciated.

Kind regards

Michael Beckinsale


--

Dave Peterson