View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Edwin Tam[_2_] Edwin Tam[_2_] is offline
external usenet poster
 
Posts: 8
Default 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