Written by Rod Wing.
As you may know, when assigning a text string to a string variable the text is enclosed in “double quotes”. If you need to have a double quote character in the string simply precede the double quote character with another double quote character.
Sub QuoteMacro()
Dim strQuote As String
strQuote = “This string has no double quotes”
strQuote = “This string has “”double quotes“” in the middle”
strQuote = “””This string has a double quote at the beginning”
strQuote = ”This string has a double quote at the end”””
strQuote = “””This string has double quotes on both ends”””
‘The following string contains a single double quote character
strQuote = “”””
End Sub
Last Month’s VBA Tip – Save User Inputs as Default Settings
Don’t want to miss out on other great information? Subscribe to this blog or our monthly eNewsletter now!
Learn More ◊ Contact us today ◊ Newsletter ◊
Yes