How to Export Excel to CSV – 4 Methods

An Excel CSV (Comma-Separated Values) file is a simple and widely used file format that stores tabular data in plain text, where each row represents a record, and each column is separated by a comma. CSV files are easily readable and can be opened by various applications including Excel.

This is an overview:

Excel CSV


Download Practice Workbook

Download the Excel files.


CSV File Formats Supported in Excel

The names, extensions, and details of the CSV file formats supported in Excel are shown below.

Name Extension Details
CSV (Comma delimited) .csv Enables the usage of a workbook by saving it as a comma-delimited text file.
Doesn’t allow special characters.
CSV UTF-8 (Comma delimited) .csv Is the same as CSV (Comma delimited) but allows special characters.
Available in Excel 2016 and later versions.
CSV (Macintosh) .csv Is the same as CSV (Comma delimited) but works on the Macintosh operating system.
CSV (MS-DOS) .csv Is the same as CSV (Comma delimited) but works on the MS-DOS operating system.

Showing different CSV file formats supported in Excel


How to Export an Excel File to a CSV File

Method 1 – Exporting the Active Sheet Only Using the Save As Command

  • Go to the File tab.

Clicking on File tab

  • Select This PC in Save As.
  • Name the file. Here, “Excel CSV”.
  • Choose CSV (Comma delimited) (*.csv) as the file type and click Save.

Saving Excel file as CSV formatted file

  • A warning will be displayed: only this sheet will be saved in CSV format.
  • Click OK.

Showing warning that only this single sheet can be saved in CSV format

The Excel sheet will be saved as a CSV formatted file.

  • There were Japanese Kanji characters in column C of the original Excel file. Here, question marks are displayed instead.

Showing Excel file exported to CSV format


Method 2 – Exporting in CSV UTF-8 Format to Preserve Special Characters

Convert the Excel file to CSV UTF-8 format  to preserve special characters.

  • Open the File tab.

Clicking on File tab

  • In Save As, choose This PC.
  • Name the file. Here, “Excel CSV UTF”.
  • Select CSV UTF-8 (Comma delimited) (*.csv) and click Save.

Saving Excel file as CSV UTF-8 formatted file

  • A warning will be displayed: only this sheet will be saved in this format.
  • Click OK.

Showing warning that only this single sheet can be saved in CSV format

 

The Japanese Kanji characters in column C are visible.

Showing Excel file exported to CSV format


Method 3 – Exporting Multiple Sheets Using VBA

To convert multiple sheets from the same Excel file into CSV format, use a VBA Macro.

  • Go to Developer > Visual Basic.
  • Or press Alt + F11 to open the Visual Basic window.

Opening Visual Basic window from Developer tab

  • Select Module in Insert to open a new Module.

Selecting Module from Insert tab in Visual Basic window

  • Enter the following code in the Module and click  Run or press F5.
Sub Exporting_Multiple_Sheets()
Application.ScreenUpdating = False
path = ActiveWorkbook.path & "\" & _
Left(ActiveWorkbook.Name, InStr(ActiveWorkbook.Name, ".") - 1)
For Each ws In Worksheets
ws.Copy
ActiveWorkbook.SaveAs Filename:=path _
& "_" & ws.Name & ".csv", FileFormat:=xlCSVUTF8, _
CreateBackup:=False
ActiveWorkbook.Close False
Next
Application.ScreenUpdating = True
End Sub
  • This VBA code automates the process of exporting each worksheet in the active workbook to separate CSV files with names based on the original workbook’s name and the individual worksheet names.

Inserting code in Module and pressing Run button

  • The CSV files will be placed in the original location of the excel file.
  • Each sheet in the Excel file will be converted to a separate CSV file.

Showing multiple sheets exported to CSV formatted files


Method 4 – Saving in XLS Format and Then Converting to CSV Format

  • To save your Excel file in XLS format, open the File tab.

Clicking on File tab

  • Select This PC in Save As.
  • Name the file. Here, “Excel CSV”.
  • To save the file in XLS format, select Excel 97-2003 Workbook (*.xls) and click Save.

Saving Excel file as XLS formatted file

  • As the original workbook was saved in the latest version of Excel, you’ll see a Compatibility Checker window with a warning.
  • Click Continue.

Clicking Continue button at Compatibility Checker window

The file is saved in XLS format.

  • Convert it to CSV format: open the File tab.

Showing Excel file in Compatibility Mode and clicking on File tab

  • Choose This PC in Save As.
  • Name the file. Here, “Excel CSV 2”.
  • Choose CSV (Comma delimited) (*.csv) and click Save.

Saving Excel file as CSV formatted file

  • A warning will be displayed: only this sheet will be saved in CSV format.
  • Click OK.

Showing warning that only this single sheet can be saved in CSV format

The active sheet will be saved in CSV format.

  • Column C displays question marks instead of special characters.
  • Save the file in CSV UTF-8 format to recognize special characters.

Showing Excel file exported to CSV format


Things to Remember

  • When you use VBA, remember to save your file in XLSM format.

Export Excel to CSV: Knowledge Hub

<< Go Back to Export Data from Excel | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Sajid Ahmed
Sajid Ahmed

Sajid Ahmed, a BSc graduate in Naval Architecture & Engineering from Bangladesh University of Engineering and Technology, assumes the position of an Excel & VBA Content Developer at ExcelDemy. A self-motivated individual, his profound interest in research and innovation aligns seamlessly with his passion for Excel. In this role, Sajid not only adeptly addresses challenges but also demonstrates enthusiasm and expertise in gracefully navigating complex situations. This underscores his steadfast commitment to consistently delivering exceptional content. His interests... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo