How to save, export multiple/all sheets to separate csv or text files in Excel?
While using Excel, you can manually save a worksheet as a csv or text file by Save As function. However, for converting multiple or all sheets in a workbook to separated csv or text file, how can you do? In this article, we will show you methods of saving or converting multiple or all sheets to separated csv or text file.
Save, export or convert all sheets to csv or text file with VBA code
Save, export or convert multiple/all sheets to csv or text file with Kutools for Excel
You may interest in:
Combine multiple worksheets/workbooks into one worksheet / workbook:
Combine multiple worksheets or workbooks into one single worksheet or workbook may be a huge task in your daily work. But, if you have Kutools for Excel, its powerful utility – Combine can help you quickly combine multiple worksheets, workbooks into one worksheet or workbook.
Kutools for Excel includes more than 300 handy Excel tools. Free to try with no limitation in 30 days. Free Download Now
- Reuse Anything: Add the most used or complex formulas, charts and anything else to your favorites, and quickly reuse them in the future.
- More than 20 text features: Extract Number from Text String; Extract or Remove Part of Texts; Convert Numbers and Currencies to English Words.
- Merge Tools: Multiple Workbooks and Sheets into One; Merge Multiple Cells/Rows/Columns Without Losing Data; Merge Duplicate Rows and Sum.
- Split Tools: Split Data into Multiple Sheets Based on Value; One Workbook to Multiple Excel, PDF or CSV Files; One Column to Multiple Columns.
- Paste Skipping Hidden/Filtered Rows; Count And Sum by Background Color; Send Personalized Emails to Multiple Recipients in Bulk.
- Super Filter: Create advanced filter schemes and apply to any sheets; Sort by week, day, frequency and more; Filter by bold, formulas, comment...
- More than 300 powerful features; Works with Office 2007-2019 and 365; Supports all languages; Easy deploying in your enterprise or organization.
Save, export or convert all sheets to csv or text file with VBA code

With the below VBA codes, you can save all worksheets in a workbook to separated csv or text files. Please do as follows.
Export or convert all sheets to csv files
1. Press Alt + F11 keys simultaneously to open the Microsoft Visual Basic Application window.
2. In the Microsoft Visual Basic Application window, click Insert > Module. Then copy and paste the following code into the Module window.
VBA code: Export all sheets to separated csv files
Sub ExportSheetsToCSV() Dim xWs As Worksheet Dim xcsvFile As String For Each xWs In Application.ActiveWorkbook.Worksheets xWs.Copy xcsvFile = CurDir & "\" & xWs.Name & ".csv" Application.ActiveWorkbook.SaveAs Filename: = xcsvFile, _ FileFormat: = xlCSV, CreateBackup: = False Application.ActiveWorkbook.Saved = True Application.ActiveWorkbook.Close Next End Sub
3. Press the F5 key to run the code. You will see all exported csv files are located on the Documents folder. See screenshot:
Export or convert all sheets to Text files
The following code can help you to export or convert all sheets in workbook to separated Text files.
VBA code: Export all sheets to separated Text files
Sub ExportSheetsToText() Dim xWs As Worksheet Dim xTextFile As String For Each xWs In Application.ActiveWorkbook.Worksheets xWs.Copy xTextFile = CurDir & "\" & xWs.Name & ".txt" Application.ActiveWorkbook.SaveAs Filename: = xTextFile, FileFormat: = xlText Application.ActiveWorkbook.Saved = True Application.ActiveWorkbook.Close Next End Sub
The exported Text files are also located on the Documents folder. See screenshot:
Save, export or convert multiple/all sheets to csv or text file with Kutools for Excel
You can quickly export or convert multiple or all sheets to individual csv files, text files or xls files format in Excel with the Split Workbook utility of Kutools for Excel.
Kutools for Excel : with more than 300 handy Excel add-ins, free to try with no limitation in 60 days.
1. Click Enterprise > Workbook > Split Workbook. See screenshot:
2. In the Split Workbook dialog box:

1). If you want to convert all sheets to csv or text files, just keep all sheet names checked in the Worksheet name box; If you just want to convert multiple sheets, keep checking them and going to uncheck other sheets you don’t want to convert.
2). In the Options section, check the Save as type box and then select Unicode Text(*.txt) or CSV (Macintosh)(*.csv) from the drop-down list.
3). Click the Split button.
3. In the Browse For Folder dialog box, specify a folder to save the exported files, and then click the OK button.
Now all sheets or specified sheets are converted to separated csv or text files, and locate on the folder as you specified above.
Save, export or convert multiple/all sheets to csv or text file with Kutools for Excel
Kutools for Excel includes more than 300 handy Excel tools. Free to try with no limitation in 60 days. Download the free trial now!
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
- Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
- Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
- Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
- Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
- Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
- Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
- Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
- Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
- More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial.

Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
