如何在Excel VBA中向单元格添加“₹”(格式化带有货币符号“₹”的单元格)

3

嗨,我正在尝试使用下面的代码格式化单元格,并期望将该单元格的货币符号设置为“₹”,其中我获取了INR值。

但是当我添加以下VBA代码时,它会用“?”将“₹”替换掉。

Selection.NumberFormat = "[$₹-hi-IN]#,##0.00"

VBA无法识别这个符号,有可能让这段代码起作用吗...

提前致谢


你尝试过 Selection.NumberFormat = "#.##0,00_-[$₹-44D]" 吗? - Foxfire And Burns And Burns
是的,VBA代码不接受 ₹ 这个符号... - dhanya
2个回答

6
Selection.NumberFormat = "[$" + ChrW(&H20B9) + "-hi-IN]#,##0.00"

3
'simple currency
Selection.NumberFormat = ChrW(8377) & "#,##0.00"
'accounting format with red bracketed negatives
Selection.NumberFormat = "_(" & ChrW(8377) & "* #,##0.00_);[red]_(" & ChrW(8377) & "* (#,##0.00);_(" & ChrW(8377) & "* ""-""??_);_(@_)"

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接