ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Saving txt files and date format changes (https://www.excelbanter.com/excel-programming/308214-saving-txt-files-date-format-changes.html)

nicoll[_2_]

Saving txt files and date format changes
 
Can anyone help me please. I'm trying to save a file as a text file. The
file has the date in a format dd/mm/yyyy. When I save manually it saves in
the correct format, but with the following


ActiveWorkbook.SaveAs Filename:= _
"c:\myfile.txt", _
FileFormat:=xlText


the date format is saved as mm/dd/yyyy, I can't work this out.

Thanks




Dave Peterson[_3_]

Saving txt files and date format changes
 
If you're going to import it back into excel, you could use the text to columns
wizard to make sure it's correct (and format the cells after you've imported the
file).

If you need it for a different purpose, maybe you can steal some code and create
your own macro that does it:

Earl Kiosterud's Text Write program:
http://www.tushar-mehta.com/
Look for Text Write in the left hand frame.

Chip Pearson's:
http://www.cpearson.com/excel/imptext.htm

J.E. McGimpsey's:
http://www.mcgimpsey.com/excel/textfiles.html

nicoll wrote:

Can anyone help me please. I'm trying to save a file as a text file. The
file has the date in a format dd/mm/yyyy. When I save manually it saves in
the correct format, but with the following

ActiveWorkbook.SaveAs Filename:= _
"c:\myfile.txt", _
FileFormat:=xlText

the date format is saved as mm/dd/yyyy, I can't work this out.

Thanks


--

Dave Peterson



All times are GMT +1. The time now is 02:06 PM.

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