Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving to CSV

Status
Not open for further replies.

Ayato

IS-IT--Management
Dec 4, 2002
11
NL
Hello,

I have an excel file with date (yymmdd) and I use a macro to save xls to csv, something like :

ActiveWorkbook.SaveAs Filename:="C:\test.200", FileFormat:=xlCSV, CreateBackup:=False

When I run the macro, the format of the dates in the csv are changing to "yyyymmdd", BUT when i do it manualy FILE>SAVE AS> .csv there is no problem, the date stays the same (yymmdd)

I have already try to paste date as values, as text before saving, always the same problem !

Any idea ?

Thx

Ayato
 
Hiya,

RobBoekhuis replied to your previoius post & like him I can't reproduce this, not when I save manually or by using your code; in both cases the date exports in yymmdd format ...

Dunno if this could have anything to do with your environment (if so, I wouldn't know where to look), but the xl cvs converter SHOULD always take text and values (including dates) as they appear in your xl sheet (sorry I know that's not very helpful ;-))

But you could try using ' followed by the date in the format you need. The apostrophe forces xl to treat the cell contents as text.

Or if you need to change a column full of dates to proper text format, use this formula (assuming that your date is currently in column A):
Code:
=TEXT(B1,"yymmdd")

Hope this helps a little

Cheers
Nikki


 
Sorry, that should be "assuming your date is in column B", of course!

Nikki

 
Why are you taking about an Excel problem on an Access board ?

Why are you talking about Macr.. mac.. m.. ( no I can't bring myself to say the word ) on a VBA board ?


Surely you'll get a lot more appropriate help if you put this onto the Microsoft: Office board





G LS
accessaceNOJUNK@valleyalley.co.uk
Remove the NOJUNK to use.
 
HO HO HO

PROBLEM SOLVED !!!!!

THX to Nikki you saved me again :))


regards from the Netherlands

Ayato
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top