Question : xl vba double quotes in string literal
Answered by : daniel-ferry
'The double quotation mark (") is ASCII character 34, so the
'following Excel formula works:
=CHAR(34) & "Excel rocks." & CHAR(34)
'This formula will display: "Excel rocks."
'Using triple double quotes has the same result:
="""Excel rocks."""
Source : http://academy.excelhero.com/ | Last Update : Sat, 04 Apr 20
Question : use " inside strin vba
Answered by : alex-lanaro-14ziv22qcwmq
'Method 1
Worksheets("Sheet1").Range("A1").Formula = "IF(Sheet1!A1=0,"""",Sheet1!A1)"
'Method 2
Worksheets("Sheet1").Range("A1").Formula = "IF(Sheet1!A1=0," & CHR(34) & CHR(34) & ",Sheet1!A1)"
Source : https://stackoverflow.com/questions/9024724/how-do-i-put-double-quotes-in-a-string-in-vba | Last Update : Sat, 21 Nov 20