In this article, we will talk about how to apply UTF 8 encoding on a CSV file in Excel. These methods will allow users to encode the CSV file with UTF 8 encoding. Thus, users will be able to encode the CSV file and transfer it into the world wide web. The UTF 8 encoding covers a wide range of characters even from various languages. So, the UTF 8 encoding is very effective in communication as well.
Download Practice Workbook
What Is UTF 8 Encoding?
The UTF 8 encoding is the most used character encoding for the internet. It is used in emails and web pages. The UTF 8 encoding not only allows access to Unicode standard characters but also ASCII characters. Thus, it allows users to accurately represent any character of any language.
2 Ways to Apply UTF 8 Encoding on CSV File in Excel
In this article we will show 2 ways to apply UTF 8 encoding on CSV file in Excel. Firstly, we will use the Save As command of Excel to do so. Then, we will use a VBA code to allow UTF 8 encoding for multiple Excel sheets.
1. Using Save As Command
In this method, we will save a CSV file with UTF 8 encoding. We will change the format of the file by using the Save As command and encode the file with UTF 8 encoding.
- Firstly, open the CSV file in the Excel application.
- Secondly, go to the File tab.
- After that, choose the Save As command.
- Then, from the drop-down list, choose CSV UTF-8 (Comma Delimited) (*.csv) option.
- Finally, click on Save.
- As a result, the CSV file will be UTF 8 encoded.
Thus, the CSV file will be UTF 8 encoded.
Read More: [Fixed!] CSV UTF 8 Not Available in Excel
2. Applying VBA to Encode CSV File
In this instance, we will use a simple VBA Code to encode multiple Excel sheets into CSV with UTF 8 encoding. Thus, all the sheets will turn into individual CSV files with UTF 8 encoding.
- First, go to the Developer Tab and then select Visual Basic.
- After that, the VBA editor will appear. Select Insert >> Module to open a VBA Module.
- Now, enter the following code in the VBA Module and Save the code.
Sub EncodingToUTF8() Dim AM_WS As Worksheet Dim AM_Path As String Application.ScreenUpdating = False AM_Path = ActiveWorkbook.Path & "\" & _ Left(ActiveWorkbook.Name, InStr(ActiveWorkbook.Name, ".") - 1) For Each AM_WS In Worksheets AM_WS.Copy ActiveWorkbook.SaveAs Filename:=AM_Path & "_" & AM_WS.Name _ & ".csv", FileFormat:=xlCSVUTF8, CreateBackup:=False ActiveWorkbook.Close False Next Application.ScreenUpdating = True End Sub
Here, we named the Subroutine as EncodingToUTF8. Then, we declared two variables. The first variable is AM_WS which is a Worksheet variable. The second one is AM_Path and it is a String type variable. In the next few lines the code takes each worksheets and changes their name to Workbook name_Worksheet name.csv in this format. Finally, the FileFormat:=xlCSVUTF8 line encodes each CSV files with UTF 8 encoding.
- Next, click on the green triangle shaped button to Run the code.
- Consequently, all the sheets will turn into UTF 8 encoded CSV files.
This is how the Excel sheets will turn into UTF 8 encoded CSV files.
How to Open UTF-8 Encoded CSV File in Excel Without Changing Language Format
It often happens that one opens a CSV file containing characters from different languages in Excel and the language format of that file changes. This is not expected at all. So, in this method we will use the Get Data command to open the CSV file without changing the language format.
- To begin with, go to the Data tab.
- Then, click on the Get Data command.
- From the drop-down, select From File.
- Next, select From Text/CSV.
- Then, select the CSV file and click on Import.
- As a result, a new window will appear on the screen.
- In the window, under the File Origin, choose 65001:Unicode (UTF-8).
- Next, select Comma as the
- Finally, click on Load.
- As a result, the CSV file data will be loaded to Excel without any change in formatting.
In this article, we have discussed 2 ways to apply UTF 8 encoding on a CSV file in Excel. These methods will allow users to encode their CSV files and share the file with other users without any difficulties. If you have any questions regarding this essay, feel free to let us know in the comments. Also, if you want to see more Excel content like this, please visit our website ExcelDemy.Com and unlock a great resource for Excel-related content.