Chr 34 in VBA

CHR is the VBA function and returns the character from the ASCII table.

For example, Chr(34) returns the 34th character, which is the “ sign (double quotes).

Example:

Look at this example. Let’s say that you want to insert the following name into the cell using the VBA code.

Edwin “Buzz” Aldrin

You can use one of the two methods.

  1. “Edwin “”Buzz”” Aldrin”
  2. “Edwin “ & chr(34) & “Buzz” & chr(34) & “ Aldrin“

To illustrate how you can Execute the following macro inside a cell, use this formula.

Both examples will display the name in double quotes.

CAUTION

Don’t confuse the chr function with the CHAR function. The first one is used in VBA, and the second one is in Excel.

Tomasz Decker is an Excel specialist, skilled in data analysis and financial modeling.