No real option - VB is the way to go. Try this for size... "All care, no responsibility"
Cut and paste into VBA (Tools, Macro, VB Editor). Click ThisWorkbook in the project window, then paste in the following:
Option Explicit Sub mysaver() Dim counter As Integer counter = 1 ' counter is for the number of sheets in the workbook Do While counter <= Worksheets.Count ' Worksheets.Count represents the total number of sheets in the workbook On Error GoTo ErrorHandler ' go to the nominated sheet Worksheets(counter).Activate ' and save it. Simple... ActiveSheet.SaveAs FileName:=ActiveSheet.Name, FileFormat:=xlCSV counter = counter + 1 Loop MsgBox "All Sheets Saved.", , "Success" Exit Sub
ErrorHandler: MsgBox "Error during save - Caution!", vbCritical, "Save Errors" Exit Sub End Sub
Replies (2)
Please login or register to join the discussion.
No real option - VB is the way to go. Try this for size...
"All care, no responsibility"
Cut and paste into VBA (Tools, Macro, VB Editor). Click ThisWorkbook in the project window, then paste in the following:
Option Explicit
Sub mysaver()
Dim counter As Integer
counter = 1
' counter is for the number of sheets in the workbook
Do While counter <= Worksheets.Count
' Worksheets.Count represents the total number of sheets in the workbook
On Error GoTo ErrorHandler
' go to the nominated sheet
Worksheets(counter).Activate
' and save it. Simple...
ActiveSheet.SaveAs FileName:=ActiveSheet.Name, FileFormat:=xlCSV
counter = counter + 1
Loop
MsgBox "All Sheets Saved.", , "Success"
Exit Sub
ErrorHandler:
MsgBox "Error during save - Caution!", vbCritical, "Save Errors"
Exit Sub
End Sub
Now try running this macro. Hope this helps.
Thanks.
Works perfectly.