How to type currency symbols in Visual Basic Editor

你离开我真会死。 提交于 2019-11-28 02:28:54
GSerg

VBA editor is not Unicode.

In order to have Unicode characters in it, you need to use ChrW$, e.g.

Dim Rupee As String
Rupee = ChrW$(&h20A8&)

Also see Unicode string literals in VBA.

I have an improved version for the answer... use the following code for making the selection in to Indian rupee Symbol with Lakhs crores format, immaterial of your regional settings in Millions format.

Dim rs As String
rs = ChrW$(&H20B9&)
Selection.NumberFormat = "[>=10000000][$" & rs & "-ta-IN] ##\,##\,##\,##0.00;[>=100000][$" & rs & "-ta-IN] ##\,##\,##0.00;[$" & rs & "-ta-IN] ##,##0.00"

Hope this helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!