Parse Functions‎ > ‎

Sheets to CSV

  1. Save path defined by user
  2. Each sheet is saved to its own CSV file using the sheet name as the file name + DATE added


Sub SheetsToCSV()
'Jerry Beaucaire (1/25/2010)
'Save each sheet to an individual CSV file
Dim ws As Worksheet, OldDir As String

Application.DisplayAlerts = False
OldDir = CurDir       'memorizes the user's current working path
ChDir "C:\2010\"      'path to save into

    For Each ws In Worksheets
        ActiveWorkbook.SaveAs Filename:=ActiveSheet.Name & "-" & _
            Format(Date, "DD-MM-YYYY") & ".csv", FileFormat:=xlCSV, CreateBackup:=False
    Next ws

ChDir OldDir         'restores user's original working path
Application.DisplayAlerts = True
End Sub

Nothing says "thanks" like a steak dinner!
PayPal - The safer, easier way to pay online!