Created
July 8, 2015 22:19
-
-
Save AlexanderMike/417b2a502109128e670f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| ' | |
| Public Sub SaveWorksheetsAsCsv() | |
| Dim WS As Excel.Worksheet | |
| Dim SaveToDirectory As String | |
| Dim CurrentWorkbook As String | |
| Dim CurrentFormat As Long | |
| CurrentWorkbook = ThisWorkbook.FullName | |
| CurrentFormat = ThisWorkbook.FileFormat | |
| SaveToDirectory = "C:\XXX" | |
| For Each WS In ThisWorkbook.Worksheets | |
| WS.SaveAs SaveToDirectory & WS.Name, xlCSV | |
| Next | |
| Application.DisplayAlerts = False | |
| ThisWorkbook.SaveAs Filename:=CurrentWorkbook, FileFormat:=CurrentFormat | |
| Application.DisplayAlerts = True | |
| End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment