Excel 2013 VBA代码中的特殊字符(字母čćžšđ) [英] Special characters (letters čćžšđ) in Excel 2013 VBA code

查看:736
本文介绍了Excel 2013 VBA代码中的特殊字符(字母čćžšđ)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Excel 2010 VBA中制作了一个程序,其中包含诸如čč...... p这样的字母.

Msgbox("Čiča gliša")有效.

像Excel 2013一样,它们在单元格和公式中支持这些字母,但在VBA中不支持.

VBA用甚至在键盘上都没有的符号代替它们.

执行代码时出现错误.

我相信这与语言设置有关.

解决方案

正如BambiLongGone所说,奇怪的字符串不太可能起作用. 我想说,您最好的选择是看这篇文章.有一个名为Unicode到VBA的工具,可用于在应用程序中转换所有字符串. 例如:

Čiča gliša

将转换为

ChrW$(&H10C) & "i" & ChrW$(&H10D) & "a gli" & ChrW$(&H161) & "a"

I made a program in Excel 2010 VBA that contains letters like ć č š...

Msgbox("Čiča gliša") works.

Looks like Excel 2013 supports those letters in cells and formulas, but not in VBA.

VBA replaces them with some symbols which aren't even on the keyboard.

I get errors executing the code.

I believe it's something to do with language settings.

解决方案

As BambiLongGone stated, weird string are not likely to work. I would say your best shot is looking at this article. There 's a tool called Unicode to VBA that you can use to convert all your string in your application. For example :

Čiča gliša

will be converted to

ChrW$(&H10C) & "i" & ChrW$(&H10D) & "a gli" & ChrW$(&H161) & "a"

这篇关于Excel 2013 VBA代码中的特殊字符(字母čćžšđ)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆