I was given a workbook with many worksheets. I need to create a macro that will save all these worksheets as a separate csv file. Is that even possible. I would love a hit on how to even get started. Any suggestions would be great.
Thanks
I was given a workbook with many worksheets. I need to create a macro that will save all these worksheets as a separate csv file. Is that even possible. I would love a hit on how to even get started. Any suggestions would be great.
Thanks
Re: Macro to save each worksheet as a csv file.
See if this does it ...
Sub ExportToCSVs()
' PDF Export Macro
' Change C:\Exports\ to your folder path where you need the diles saved
' Save Each Worksheet to a separate PDF file.
Dim ws As Worksheet
Dim nm As String
Application.ScreenUpdating = False
For Each ws In Worksheets
ws.Select
nm = ws.Name
ActiveSheet.SaveAs Filename:="C:\Users\My\Desktop\" & nm & ".csv", _
FileFormat:=xlCSV, CreateBackup:=False
Next ws
Sheets("Sheet1").Activate
ActiveSheet.Range("A1").Select
Application.ScreenUpdating = True
MsgBox "Sent"
End Sub
Display More
Re: Macro to save each worksheet as a csv file.
Fantastic.. This is awesome.. Works great.. I am just learning this and it's like trying to learn a foreign language..
Re: Macro to save each worksheet as a csv file.
Great. Glad it worked for you.
Yes, VBA is a language and sometimes it frustrates me as 'foreign' also.
Good job!
Don’t have an account yet? Register yourself now and be a part of our community!