Split data - save to csv file

Copper Contributor

I am VBA code to split data in my excel spreadsheet.

 

What code can I add to automatically save it in to a csv. file? It is currently saving to Microsoft Excel 97-2003 Worksheet (.xls).

LauraBackshell_0-1677239520580.png

 

 

 

3 Replies

@Laura Backshell 

Try

        .SaveAs FileName:=ACS.Parent.Parent.Path & Application.PathSeparator & "file-" & Z & ".csv", FileFormat:=xlCSV

cheers this is great - but its changed the format of the date. Any way to stop this from happening?

 

Can it save direct to the folder rather than opening once created?

@Laura Backshell You'd probably have to use a column with formulas of the form

 

=TEXT(datecell, "desiredformat")

 

I don't understand your question "Can it save direct to the folder rather than opening once created?"