Archive of Mr Excel Message Board
ex:
dim String as string
String = "This is the Test only." & """ & "double ok" & """ & "."
The string output value I am looking for is something like
this
This is the test "double ok".
""" does not work for me, what else should I try.
Thank you for helping

| Check out our Excel VBA Resources | ||||
![]() |
![]() |
![]() |
![]() |
![]() |
The way I like is to include chr(34), which is the double quote.
For example,
str = chr(34) & "There should be a double quote before and after this sentence" & chr(34)
str should equal "There should be a double quote before and after this sentence" (with quotes included).

Sorry, I found the solution now.
I can use
String = "This is the Test only." & chr(34) & "double ok" & chr(34) & "."

Hello,
Try using Chr(34) which return the character associated with the specified ASCII code - in this case the "
S = "This is the Test only." & Chr(34) & "double ok" & Chr(34) & "."
HTH,
Dax.

