Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nicolasguzca/8b603efd225082884c95b95769afe8b6 to your computer and use it in GitHub Desktop.
Save nicolasguzca/8b603efd225082884c95b95769afe8b6 to your computer and use it in GitHub Desktop.
Sub ExportSheetsToCSV()
Dim xWs As Worksheet
Dim xcsvFile As String
For Each xWs In Application.ActiveWorkbook.Worksheets
xWs.Copy
xcsvFile = CurDir & "\" & xWs.Name & ".csv"
Application.ActiveWorkbook.SaveAs Filename:=xcsvFile, _
FileFormat:=xlCSV, CreateBackup:=False
Application.ActiveWorkbook.Saved = True
Application.ActiveWorkbook.Close
Next
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment