I am doing the following steps and running into problem with UTF-8 characters:
- Read CSV file (delimited with "|") containing UTF-8 characters.
- Parse the file and save a new file based on certain conditions (Eliminate rows with Remove_ROW text in the same is one of the criteria)
The saved file that I have doesn't save the UTF-8 characters. It is just saving it with some garbled characters.
Set tdaywb = Workbooks.Open(lbltoday.Caption) 'lbltoday.Caption has the filename
Set tdaySht = tdaywb.Sheets(1)
tdayLastRow = tdaySht.Range("A" & Rows.Count).End(xlUp).Row
For x = 2 To tdayLastRow
If x > tdayLastRow Then
Exit For
End If
If InStr(1, tdaySht.Cells(x, 1), "Remove_ROW") > 0 Then
tdaySht.Rows(x).EntireRow.Delete
remCount = remCount + 1
tdayLastRow = tdayLastRow - 1
End If
Next x
tdaySht.Activate
With ActiveWorkbook
.SaveAs "C:\test.csv"
.Close 0
End With
I will appreciate help for how can I save this with the UTF-8 characters preserved.
Regards, Ayush
After some research here is what I found: