Functions of Char, CHR, ChrW three functions: All three functions take the character code as the parameter and return the character corresponding to the code.
A char function can be used in a formula
Where the char function is a worksheet function that can be used in an Excel formula, you can return the character corresponding to the ASCII code, with a parameter range of 1~255, such as char (= "A"). Returns an error value when the argument is greater than 255 #value!
Two, CHR, ChrW functions can only be used in VBA
The ①CHR function is a function in VBA that returns the character corresponding to the ANSI character code.
When the parameter range is 0~255, the character corresponding to the ASCII code is returned, such as using code range ("A1") =CHR (65) to display the character "A" in the A1 cell.
When the parameter is in the [ -32768,-1] or [256,65535] interval, the function returns the corresponding character of non-Unicode in the current character set, such as using code Range ("A1") = Chr (33119) to display the character "A1" in the book cell.
The ②CHRW function is also a function in VBA that returns the character corresponding to the ANSI character code.
When the range of arguments is 0~255, the character corresponding to the ASCII code is returned, the same as the CHR function, for example, using the code
Range ("A1") =CHRW (65)
You can display the character "A" in cell A1. When the parameter is in the [ -32768,-1] or [256,65535] interval, the function returns the corresponding character for Unicode in the current character set, for example, by using code Range ("A1") = ChrW (33119) to display the character "A1" in the 腟 cell.