Advertisement
Guest User

Macro to export to CSV

a guest
Oct 21st, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub SaveCSV()
  2. Application.DisplayAlerts = False
  3.  
  4. For Each mySheet In ActiveWorkbook.Worksheets
  5.     ThisWorkbook.Sheets(mySheet.Index).Copy
  6.     ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path + "\" + mySheet.Name + ".csv", FileFormat:=xlCSV, CreateBackup:=False
  7.     ActiveWorkbook.Close
  8. Next mySheet
  9.  
  10. Application.DisplayAlerts = True
  11. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement