Export all Google Sheets to csv

I had a Google Apps spreadsheet with around 40 sheets. Wanted to export them to csv. Unfortunately Google only lets you export one sheet at a time.

Here’s a script that exports all sheets in a spreadsheet to csv

To use, click on tools –> script editor. Then create a new blank script and paste the code there.

Click on the play button (run) and go back to your spreadsheet. You should then see the csv in the spreadsheet menu