CSV, short for Comma Separated Values, is a widely used file format used to store delimited records in plain text. It is often used to transfer data between different applications due it’s small file size and simplicity, especially for large datasets. Let’s examine some easy ways to create CSV files from Excel.
Watch Video – Create CSV File from Excel
To illustrate, we’ll use the following source file as our dataset. It’s a daily Sales Report of a particular fast food store, and contains data about the Salesman, Item, and Qty in columns B, C, and D respectively. Here, we have used Microsoft Excel 365 version, however you may use any other version of Excel instead.
The Save As dialog box appears.
Note: After pressing the Save button, you’ll get a warning dialog box reminding you that only the active worksheet will get converted to a CSV file. Perform the above steps for each additional worksheet you want to save.
A CSV file with the same name will be created in the specified location on your PC.
The file opens in the Notepad app.
You can also open the same file with Excel. But it won’t look like before. It’ll show the data without any type of formatting.
The above method is simple, but it has a drawback. It can’t transform the special characters (Non-ASCII characters). However it is possible to create a CSV file without destroying special characters.
In the following dataset, we have two item names written in Japanese.
Steps:
A CSV file of the current sheet will be created. If you open the file in Excel, you can see that the special characters, which were displayed as . (question marks) in Method 1, now display correctly in the CSV file too.
Here’s a different method to create a CSV file with special characters from Excel.
Steps:
A text file will be created with the .txt extension.
The Save As dialog box of the Notepad app will open.
A CSV file that contains the special characters correctly is created.
We can use Google Sheets for the creation of a CSV file from Excel.
Steps:
The file will open in the spreadsheet.
You’ll get a new CSV file as shown in the following picture:
You can automate the prior method entirely with the help of VBA.
Steps:
The Microsoft Visual Basic for Applications window appears.
Sub create_csv_from_excel() Dim wst As Worksheet Dim path_x As String Application.ScreenUpdating = False path_x = ActiveWorkbook.Path & " " & Left(ActiveWorkbook.Name, _ InStr(ActiveWorkbook.Name, ".") - 1) For Each wst In Worksheets wst.Copy ActiveWorkbook.SaveAs Filename:=path_x & "" & wst.Name & ".csv", _ FileFormat:=xlCSV, CreateBackup:=False ActiveWorkbook.Close False Next Application.ScreenUpdating = True End Sub
It’ll create a separate CSV file.
We can also create a CSV file without even opening our Excel file, by means of an online file converter.
Steps:
Here, we have a Contact List as an Excel workbook. Let’s make a CSV file from this dataset.
Steps: