Created
April 8, 2016 17:32
-
-
Save LeeMendelowitz/a82fe961019a4f60c5b7c380b8cb1de4 to your computer and use it in GitHub Desktop.
Excel Macro for exporting all sheets as csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub ExportSheetsToCSV() | |
Dim xWs As Worksheet | |
Dim xcsvFile As String | |
For Each xWs In Application.ActiveWorkbook.Worksheets | |
xWs.Copy | |
xcsvFile = 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