【发布时间】:2015-03-24 00:48:27
【问题描述】:
我想使用 VBA 读取文本文件,提取相关数据并转换为 Excel 文件。这是我正在使用的代码类型:
Sub ReadText()
Dim myFile As String, textline As String
myFile = Application.GetOpenFilename()
Open myFile For Input As #1
LineNumber = 0
Do Until EOF(1)
LineNumber = LineNumber + 1
Line Input #1, textline
'do stuff to extract the info I want and transfer to Excel
Loop
Close #1
End Sub
我住在一个讲西班牙语的国家,所以我需要保留很多重音字符。问题是这些重音字符正在转换为其他字符。例如,应该读作 INGLÉS 的内容被读作 INGLÉS
我已经看到有替换重音字符的解决方案,但我不想这样做,因为我想要对 Excel 中的信息执行的操作仍然需要重音符号。
我是否在某处缺少格式选项?
【问题讨论】: