简体   繁体   English

Vba excel 将单元格转换为希伯来货币 (ILS)

[英]Vba excel convert cell to Hebrew currency (ILS)

I am trying to convert cells with numbers to Hebrew currency format, instead of getting the sign of currency I get question mark sign like in an example attached.我正在尝试将带有数字的单元格转换为希伯来语货币格式,而不是获取货币符号,而是像所附示例中那样得到问号符号。 I've rerecorded a macro but it just doesn't seem to work我重新录制了一个宏,但它似乎不起作用

在此处输入图片说明

Range("I4", "I" & LastRow).NumberFormat = _
    "_ [$?-40D] * #,##0.00_ ;_ [$?-40D] * -#,##0.00_ ;_ [$?-40D] * ""-""??_ ;_ @_ "

Thank in advance, I would appreciate a lot If someone could answer my question提前致谢,如果有人能回答我的问题,我将不胜感激

The VBA editor doesn't recognize the Hebrew currency symbol so you can use an ASCII character instead. VBA 编辑器无法识别希伯来语货币符号,因此您可以改用 ASCII 字符。 The one your looking for is ChrW(8362).您要找的是 ChrW(8362)。 I found the correct character code from this website .我从这个网站找到了正确的字符代码。

Example:例子:

ActiveCell.NumberFormat = _
"_ [$" & ChrW(8362) & "-10D] * #,##0.00_ ;_ [$" & ChrW(8362) & "-10D] * -#,##0.00_ ;_ [$" & ChrW(8362) & "-10D] * ""-""tt_ ;_ @_ "

Result:结果:

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM