ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Date Format problem (https://www.excelbanter.com/excel-programming/324495-date-format-problem.html)

SW[_5_]

Date Format problem
 
Hi,

I am using a macro to open a csv file, make some changes then save it.
I'm using

ActiveWorkbook.SaveAs FileFormat:=xlCSVWindows
ActiveWorkbook.Close SaveChanges:=True

to save the file.

The problem is, some of the data (which I'm not changing) is dates, eg
15/02/2005
this appears in the saved file as 2/15/2005.
I've checked my International settings and they're all UK so I don't know
what's wrong.
I've tried different file formats.
I just want the date to remain unchanged.

Thanks in advance for your help.

Regards
SW



Pete[_22_]

Date Format problem
 
Under 'Customise Regional Options' is the short date format actually set to
dd/MM/yyyy ?
Peter Bircher

"SW" wrote in message
...
Hi,

I am using a macro to open a csv file, make some changes then save it.
I'm using

ActiveWorkbook.SaveAs FileFormat:=xlCSVWindows
ActiveWorkbook.Close SaveChanges:=True

to save the file.

The problem is, some of the data (which I'm not changing) is dates, eg
15/02/2005
this appears in the saved file as 2/15/2005.
I've checked my International settings and they're all UK so I don't know
what's wrong.
I've tried different file formats.
I just want the date to remain unchanged.

Thanks in advance for your help.

Regards
SW





SW[_5_]

Date Format problem
 
Yes, it is.
That's what baffles me.

"Pete" wrote in message
...
Under 'Customise Regional Options' is the short date format actually set

to
dd/MM/yyyy ?
Peter Bircher

"SW" wrote in message
...
Hi,

I am using a macro to open a csv file, make some changes then save it.
I'm using

ActiveWorkbook.SaveAs FileFormat:=xlCSVWindows
ActiveWorkbook.Close SaveChanges:=True

to save the file.

The problem is, some of the data (which I'm not changing) is dates, eg
15/02/2005
this appears in the saved file as 2/15/2005.
I've checked my International settings and they're all UK so I don't

know
what's wrong.
I've tried different file formats.
I just want the date to remain unchanged.

Thanks in advance for your help.

Regards
SW







SW[_5_]

Date Format problem
 
I cured this by putting a line in the code to format the date on each row
into the format I wanted. (It was already in that format to start with, but
hey! it works.)
SW
"Pete" wrote in message
...
Under 'Customise Regional Options' is the short date format actually set

to
dd/MM/yyyy ?
Peter Bircher

"SW" wrote in message
...
Hi,

I am using a macro to open a csv file, make some changes then save it.
I'm using

ActiveWorkbook.SaveAs FileFormat:=xlCSVWindows
ActiveWorkbook.Close SaveChanges:=True

to save the file.

The problem is, some of the data (which I'm not changing) is dates, eg
15/02/2005
this appears in the saved file as 2/15/2005.
I've checked my International settings and they're all UK so I don't

know
what's wrong.
I've tried different file formats.
I just want the date to remain unchanged.

Thanks in advance for your help.

Regards
SW








All times are GMT +1. The time now is 10:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com