SaveAs csv
Gert wrote:
Hi,
I have to save one specific sheet (or a copy of this sheet) as a scv
file but at the same time I want to keep the original workbook a xls
file.
Is it possible to do this with a macro ???
thanks in advance
Gert
Sub saveascsv()
Dim SaveName
SaveName = "C:\mycsvfile.csv" 'you can refer to a range.text if you want to
make this dynamic
Worksheets("Sheet1").Copy
Workbooks(Workbooks.Count).Activate
Workbooks(Workbooks.Count).SaveAs SaveName, xlCSV
Workbooks(Workbooks.Count).Close SaveChanges:=False
End Sub
|