Hi I have the below Code but would only like to export a range of some of my worksheets as CSV and also would not like it to change my sheet names on the original excel file.
Currently this exports all the sheets and renames each sheet to include the DDMMYYYY
Public Sub SaveWorksheetsAsCsv()
Dim wb As Workbook
Dim WS As Worksheet
Dim SaveToDirectory As String
Dim CurrentWorkbook As String
Dim CurrentFormat As Long
CurrentWorkbook = ThisWorkbook.FullName
CurrentFormat = ThisWorkbook.FileFormat
SaveToDirectory = "C:\Users\Greg.Becroft\Desktop\P\"
For Each WS In ThisWorkbook.Worksheets
WS.SaveAs SaveToDirectory & WS.Name & Format(Now(), "DDMMYYYY"), xlCSV
Next
Application.DisplayAlerts = False
ThisWorkbook.SaveAs Filename:=CurrentWorkbook, FileFormat:=CurrentFormat
Application.DisplayAlerts = True
End Sub
Currently this exports all the sheets and renames each sheet to include the DDMMYYYY
Public Sub SaveWorksheetsAsCsv()
Dim wb As Workbook
Dim WS As Worksheet
Dim SaveToDirectory As String
Dim CurrentWorkbook As String
Dim CurrentFormat As Long
CurrentWorkbook = ThisWorkbook.FullName
CurrentFormat = ThisWorkbook.FileFormat
SaveToDirectory = "C:\Users\Greg.Becroft\Desktop\P\"
For Each WS In ThisWorkbook.Worksheets
WS.SaveAs SaveToDirectory & WS.Name & Format(Now(), "DDMMYYYY"), xlCSV
Next
Application.DisplayAlerts = False
ThisWorkbook.SaveAs Filename:=CurrentWorkbook, FileFormat:=CurrentFormat
Application.DisplayAlerts = True
End Sub