Dates changing when opening a CSV

S

Skeniver

Hi there

I am opening a CSV file with a bank account statement details in. Excel is
changing the date for mat for some of the dates (but not all of them). So
01/08/2008 (1 Aug 08) is becoming 08/01/2008 (8 Jan 08), but this only
happens for dates before the 12th of every month. It's really irritating! If
I open the CSV manually, it works fine, but with my macro it changes. I can't
figure out a solution...

PLEASE HELP!

ps. I am using Office 2003.
 
D

Dave Peterson

Rename your .csv file to .txt.

Then open excel and use File|Open to open the text file.

You'll see a text import wizard appear where you can specify each
field--including the order of the date fields.
 
L

Leo Mazzi

Since you are not specifying the format of the date, Excel tries to figure it
out by itself. Seems that the default date format Excel is using (I belive
that this depends on your regional settings) is month/day/year. For dates
where there is no problem in conversion (because you have 12 days and 12
months) it selects the default format - otherwise it tries to figure out the
possible format so it tries to use day/month/year.

Unfortunately for you all your dates are in the format day/month/year :)

I belive that the solution that Dave gave you will fix the problem - script
the procedure and you'll have the correct macro :)

Best regards,
Leo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top