How to convert CSV files to Excel in bulk
CSV files are often used with accountants because the structure of functions and commands that have been done before are retained. Currently, CSV files can be opened in Excel, or open CSV files in Google Sheets easily. However, CSV file when working in Excel may encounter some errors such as Vietnamese error when opening the CSV file in Excel for example. So many people want to convert a CSV file to an Excel file to work more conveniently.
To convert a CSV file to Excel format there are many different ways to do it. If you want to batch convert CSV files to Excel, you can refer to the following article of Network Administration. With just a few simple steps, we now have XLS or XLSX Excel files easily, without the need for software support.
- How to convert a PDF file to Excel keeps the same format
- The simple way to convert XLSX files to XLS
- How to convert Excel files to Google Sheets
- How to delete table format in Excel
1. Convert CSV file to batch XLS file
Step 1:
First of all we will group the CSV files to be converted into XLS format into the same directory as the image below.
Step 2:
Next, users open Excel and then click on Developer tab and then on Visual Basic .
Step 3:
Switch to the new user interface, click Insert and then select Module to open the interface to enter the VBA code in Excel.
Then we paste the code below into the interface in Excel.
Sub CSVtoXLS() 'UpdatebyExtendoffice20170814 Dim xFd As FileDialog Dim xSPath As String Dim xCSVFile As String Dim xWsheet As String Application.DisplayAlerts = False Application.StatusBar = True xWsheet = ActiveWorkbook.Name Set xFd = Application.FileDialog(msoFileDialogFolderPicker) xFd.Title = "Select a folder:" If xFd.Show = -1 Then xSPath = xFd.SelectedItems(1) Else Exit Sub End If If Right(xSPath, 1) <> "" Then xSPath = xSPath + "" xCSVFile = Dir(xSPath & "*.csv") Do While xCSVFile <> "" Application.StatusBar = "Converting: " & xCSVFile Workbooks.Open Filename:=xSPath & xCSVFile ActiveWorkbook.SaveAs Replace(xSPath & xCSVFile, ".csv", ".xls", vbTextCompare), xlNormal ActiveWorkbook.Close Windows(xWsheet).Activate xCSVFile = Dir Loop Application.StatusBar = False Application.DisplayAlerts = True End Sub
Step 4:
Finally, click the Run icon in the upper toolbar as shown below to run VBA code.
Now display the folder on the computer so we can choose the folder containing the CSV file to move to Excel file, click OK. Soon VBA code will run and convert the file. At the end of the conversion process you open the previously saved CSV file folder.
Step 5:
As a result, we will see the XLS files as shown below.
2. Convert CSV file to XLSX file in batch
In addition to converting CSV to XLS as above we can also convert CSV files to XLSX easily. First, you also open VBA code editor in Excel and enter the code as shown below.
Sub CSVTOXLSX() 'UpdatebyExtendoffice20170814 Dim xFd As FileDialog Dim xSPath As String Dim xCSVFile As String Dim xWsheet As String Application.DisplayAlerts = False Application.StatusBar = True xWsheet = ActiveWorkbook.Name Set xFd = Application.FileDialog(msoFileDialogFolderPicker) xFd.Title = "Select a folder:" If xFd.Show = -1 Then xSPath = xFd.SelectedItems(1) Else Exit Sub End If If Right(xSPath, 1) <> "" Then xSPath = xSPath + "" xCSVFile = Dir(xSPath & "*.csv") Do While xCSVFile <> "" Application.StatusBar = "Converting: " & xCSVFile Workbooks.Open Filename:=xSPath & xCSVFile ActiveWorkbook.SaveAs Replace(xSPath & xCSVFile, ".csv", ".XLXS", vbTextCompare), xlWorkbookDefault ActiveWorkbook.Close Windows(xWsheet).Activate xCSVFile = Dir Loop Application.StatusBar = False Application.DisplayAlerts = True End Sub
Then click the Run button to run the VBA code.
When the conversion process is complete and open the folder containing the CSV file, you will see the converted XLXS files.
3. Convert the CSV file to Excel online
The online conversion tools now also support transferring multiple files at the same time, convenient for users to work. There are many file format conversion tools such as Onlineconvertfree for example.
We access the link below to open the CSV to XLS conversion right away. If you want to convert to XLXS, you only need to change the format conversion item. Then click Choose File to upload the CSV file.
https://onlineconvertfree.com/convert-format/csv-to-xls/
Finally click Convert to finish the conversion.
So we have ways to convert a series of CSV files into Excel files already. If you are not familiar with VBA code in Excel, you can use the online conversion tools also very useful.
I wish you successful implementation!
You should read it
- How to convert money into words in Excel, without an add-in, supports both 32-bit and 64-bit Excel
- How to Convert Measurements Easily in Microsoft Excel
- How to convert PDF files to Excel keeps formatting
- How to convert PDF to Excel
- How to convert columns into rows and rows into columns in Excel
- How to convert Office documents to PDF on Microsoft Office 2016
- How to convert Cad to Word, PDF, Excel
- How to use the Convert function on Excel
May be interested
- 2 ways to convert JPG image file to PDFyesterday, we showed you how to convert excel files to pdf files. today, we will continue to share with you 2 simple ways to convert jpg image file to pdf format. let's refer to offline.
- The easiest way to Convert XML to Exceltoday's tipsmake will show you how to import xml files into a microsoft excel spreadsheet set on windows or macos. open microsoft excel.
- How to convert Excel to PDF keeping the formattingconverting excel files to pdf is very simple, this article will show you 3 fastest ways to convert from excel to pdf without losing formatting.
- Convert CAD files to PDFconvert cad files to pdf. pdf files are popular text files, the advantage of this format is that they are highly secure and lightweight, suitable for sending via email to others. thuthuatphanmem.vn will guide you some ways to convert cad files to pdf extremely simple
- How to convert MP4 files to MP3this article shows you how to use 3 easy-to-use, free online file converters to convert mp4 files to mp3 in just a few minutes.
- How to convert a Word file to Excelyou have a word file but you want to switch to excel to make it easier to calculate and process data. but if you enter it again, it will take a lot of time, so you are looking to convert word files into excel. below tutorial guide to you two c
- how to convert a JPG file to PDF with just one operationconvert jpg files to pdf quickly, users always need to convert jpg files to pdf with the purpose of creating a variety of presentation content, easier to share, reduce image size and especially have higher security.
- How to convert money into words in Excel, without an add-in, supports both 32-bit and 64-bit Excelconvert numbers into words in excel, convert amounts into words with excel versions from 2003 to 2016, excel free like wps office, no need to install add-ins, support both 32-bit and 64-bit versions.
- How to convert PDF to Excelhow to convert pdf to excel. when the excel report is completed, the user wants to send the form without losing the format, the original design is often converted to pdf.
- What file is XLL? How to open, edit and convert XLL filesfiles with the .xll extension are excel add-in files. these files offer and provide ways to use third-party tools and functions in microsoft excel, which are not part of this software.