【问题标题】:Displaying Unicode characters: Excel 2010 vs Excel 2013显示 Unicode 字符:Excel 2010 与 Excel 2013
【发布时间】:2013-02-18 20:56:43
【问题描述】:

我需要用纯 ASCII 代替 Excel 电子表格中的 Unicode 字符。例如,将 Ståle 转换为 Stale。

以下内容在 Excel 2013 中运行良好。但在 Excel 2010 中,“?”显示而不是有问题的字符。有任何想法吗?请注意,在 Excel 2010 中可以正确检测到非 Ascii 字符,但不会显示这些字符。

char = Mid(val, i, 1)
char_code = AscW(char)
If char_code > 127 Then
  MsgBox ("Problem with " & c.Address & " [" & char_code & "] " &
    StrConv(ChrW(char_code), vbUnicode))
End If

我也试过了

MsgBox ("Problem with " & char & " " & ChrW(char_code))

它再次适用于 Excel 2013,但不适用于 Excel 2010。

【问题讨论】:

  • 也许作为一个选项,这将是好的:asap-utilities.com/…
  • StrConv 依赖于默认代码页。我假设您正在不同的计算机上尝试此操作。装有 Excel 2010 的计算机是否有正确的代码页?将 char_code 转换为十六进制会是更好的选择吗?

标签: excel internationalization excel-2010 vba


【解决方案1】:

更多研究表明:

Excel 2010 的 MsgBox 控件不支持 Unicode 字符。 Excel 2013 MsgBox 可以。

将字符插入工作表单元格时,Unicode 非 ASCII 字符可以正常工作。问题仅在于使用 MsgBox 显示它时。好消息是这个问题在 Excel 2013 中得到了修复。More on the subject.

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-02-29
    • 1970-01-01
    • 1970-01-01
    • 2013-11-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多