ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how to write other language in text file from VBA (https://www.excelbanter.com/excel-programming/289234-how-write-other-language-text-file-vba.html)

Ravi

how to write other language in text file from VBA
 
i have one excel sheet , in that sheet, user input in chineese character. i want to create a text file in chineese based on the user input

Please help me in this regard

Thanx in advanc

Ravi

Edwin Tam[_2_]

how to write other language in text file from VBA
 
Writing Chinese characters to a text file is the same as writing English and numbers
For example, you got a list of Chinese words in column A. The following macro writes the content in Column A to the text file "TESTFILE.txt". See the following macro

Sub write_file(
Dim tmp As Singl
Open "TESTFILE.txt" For Output As #1 ' Open file for output
For tmp = 1 To Range("A1").CurrentRegion.Rows.Coun
Write #1, Range("a1").Offset(tmp - 1, 0).Value ' Write comma-delimited dat
Nex
Close #1 ' Close file
End Su

I speak Chinese and use both Simplified and Traditional Chinese in Windows English version. I tested the above approach and had no problem at all with the above macro



All times are GMT +1. The time now is 02:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com