Insert Double Quotes in a String in VBA

We can recognize a string in VBA when the value is inside double-quotes. Let’s how it works inside VBA editor.

If you run this code, it will display the message inside a worksheet.

The message is displayed without double quotes and is treated as a number.

If you want to display string with double quotes, you just have to add additional quotes.

If you run this code, Excel will display a text with double-quotes.

If you want to add double double-quotes, you have to use 5 double-quotes for each side.

Run the code, to get the result.

The more practical way to use double-quotes inside a string is to use it for names.

This code will generate the following result:

Posted in vba