How to Export All Sheets in an Excel File?
July 22, 2013 4:46 PM   Subscribe

I am using Excel 2011 on Mac OS X Lion. I have a workbook created by a colleague with 25 worksheets in it. I would like to export all of these to individual csv files. Is there a way to do it all in one batch?

I have tried various macros I found online, but I suspect these are all incompatible with Excel 2011/Mac, as they either do nothing, or they cause Excel to shut down. It might be that I don't know how to run macros properly, so if you have something that has worked for you on Excel 2011, please suggest it as well as maybe some dumbed down instructions for how to use it.
posted by bluefly to Computers & Internet (2 answers total) 4 users marked this as a favorite
 
Best answer: The following code seems to work for me:

Sub AllSheetsToCSV()
For Each s In Sheets
s.Activate
ActiveWorkbook.SaveAs Filename:=s.Name, FileFormat:=xlCSV
Next s
End Sub


To use: Open VBA editor. Create new module. Paste code into module. Hit play.
posted by pompomtom at 5:01 PM on July 22, 2013 [1 favorite]


Response by poster: That worked! Thanks so much pompomtom; you've saved me so much time.
posted by bluefly at 6:26 PM on July 22, 2013


« Older I Can't Help It If I've Got a Heavy Flow and a...   |   How can I buy something from Cutco with the least... Newer »
This thread is closed to new comments.