VBA 转义字符

示例

VBA语法要求在字符串中包含一个字符串字面量",因此,当您的字符串需要包含引号时,您需要对"字符进行转义/前缀,"以便VBA理解您打算将""其解释为"字符串。

'The following 2 lines produce the same output
Debug.Print "The man said, ""Never use air-quotes"""
Debug.Print "The man said, " & """" & "Never use air-quotes" & """"

'Output:
'The man said, "Never use air-quotes"
'The man said, "Never use air-quotes"