Convert Multi-Sheet Excel to Multiple CSVs
How to export every sheet in an Excel workbook to separate CSV files. Use VBA macros, Python, or online tools to save time.
Convert Multi-Sheet Excel to Multiple CSVs
You have an Excel workbook with 20 sheets ("Jan", "Feb", "Mar"...). You need 20 separate CSV files.
If you use File > Save As > CSV, Excel only saves the active sheet. You have to click each sheet and save it manually 20 times. Painful.
Here is how to export all sheets at once.
Method 1: VBA Macro (Built-in)
You can tell Excel to loop through every sheet and save it.
- Open your Excel file.
- Press Alt + F11 to open the VBA Editor.
- Insert > Module.
- Paste this code:
Sub SaveAllSheetsAsCSV()
Dim ws As Worksheet
Dim path As String
path = Application.ActiveWorkbook.Path & "\"
For Each ws In Worksheets
ws.Copy
ActiveWorkbook.SaveAs Filename:=path & ws.Name & ".csv", FileFormat:=xlCSV
ActiveWorkbook.Close SaveChanges:=False
Next ws
End Sub
- Press F5 to run.
- Check your folder. You should see
Jan.csv,Feb.csv, etc.
Method 2: Python (Pandas)
If you have Python installed, this is cleaner and doesn't require enabling macros.
import pandas as pd
import os
excel_file = 'data.xlsx'
xls = pd.ExcelFile(excel_file)
for sheet_name in xls.sheet_names:
df = pd.read_excel(excel_file, sheet_name=sheet_name)
df.to_csv(f'{sheet_name}.csv', index=False)
Method 3: Google Sheets
Google Sheets also defaults to downloading the current sheet. But you can use a script.
- Extensions > Apps Script.
- Paste a script (similar logic to VBA) to save files to Drive.
- Or, simpler: Download the whole file as ODS (OpenDocument), unzip it, and convert the XMLs... actually, that's too hard. Stick to Method 1 or 2.
Method 4: Online Converters
Some online tools allow you to upload an XLSX and download a ZIP of CSVs.
Summary
- Excel default: Only saves active sheet.
- VBA: Best for quick local batching.
- Python: Best for automated pipelines.
Don't waste time saving 50 sheets manually!
Too many sheets? HappyCSV can extract all your Excel sheets into separate CSV files in one click.
Related Articles
Convert CSV to HTML Table
Convert CSV files to HTML table code for websites. Free online tool with proper escaping and semantic markup.
Convert CSV to Markdown Table
Convert CSV files to Markdown tables for GitHub README files, documentation, and blog posts. Free online tool.
Convert TSV to CSV (Tab-Separated to Comma-Separated)
Convert TSV files to standard CSV format. Free online converter for tab-delimited data. Works with Excel exports.
Need to handle CSV files?
HappyCSV is the free, secure way to merge, split, and clean your data — all in your browser.