Monday, August 22, 2016

Use Special Characters in Excel Formula or in VBA Code

We can use the Special Characters ($ – Dollar Sign, ” – Double Quote, & – Ampersand Sign, ( – Opening Braces, ) – Closing Braces, @ – At the rate Sign) in the Excel Formulas or in the VBA Code, but as their Syntax only. If we want to use them as a character, we'll not be able to use. As using them, will spoil the syntax of the formula and it will through an error. But still Some times we'll be require to use Special Characters in the Excel Formulas or in the VBA Code programming as a character. So in this scenario we can use the ASCII number of those characters. ASCII values can be used to refer the characters in both Excel formulas as well as Excel VBA.

Use of ASCII numbers in Excel Formulas as well as Excel VBA programming:

Excel Formulas          =CHAR(ASCII Number)
Excel VBA                    VBA.Chr(ASCII Number)

 

Use Special Characters in Excel Formula or in VBA Code Image



No comments:

Post a Comment