CHR 34 in VBA
Written by
Reviewed by
This article will explain the role of chr 34 in VBA.
Every character in Excel has an assigned number code. The Chr Function (when combined with a number) returns a value from the ASCII table that corresponds to the number that has been used.
When this function is combined with the number 34, it will return double-quotes.
Inserting a Double-Quote into a String
Occasionally, inserting a double-quote into a string makes the string easier to read and to understand. We use the Chr function together with the number 34 to do this.
In the above code snippet, we are showing the name of a person in a message box, including his nickname which many might think is actually his name!