VBA 转义字符
示例
VBA语法要求在字符串中包含一个字符串字面量",因此,当您的字符串需要包含引号时,您需要对"字符进行转义/前缀,"以便VBA理解您打算将""其解释为"字符串。
'The following 2 lines produce the same outputDebug.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"
以上是 VBA 转义字符 的全部内容, 来源链接: utcz.com/z/358292.html