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.
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 = “”””
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 ◊