General discussion


export xls to csv

By pm ·

I'm looking for a macro in excel that lets me export to csv.
The filename must be the name of the sheet combined with the month and year on the moment of export.
Can somebody help me out? I've been searching for a few hours but no luck so far.

Kind regards,

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

by rkuhn In reply to export xls to csv

Might take a bit tweaking like where you want to save the file (I used the desktop of my profile) and the time/date format (I just used dd-mm-yyyy) but that's your basic code.

Sub Macro1()
' Macro1 Macro
' Macro recorded 5/2/2006 by rickk
' Keyboard Shortcut: Ctrl+p
ChDir "C:\Documents and Settings\rickk\Desktop"
ActiveWorkbook.SaveAs Filename:="C:\Documents and Settings\rickk\Desktop\" & ActiveSheet.Name & " " & Format(Date, "dd-mm-yyyy"), _
FileFormat:=xlCSV, CreateBackup:=False
End Sub

Collapse -

Convert XLS to CSV

by xlstocsv In reply to export xls to csv

You can easily do that, check the info here, free!

Related Discussions

Related Forums