>Hi All
>
>I am new to VBA, as I am a visual foxpro programmer.
>
>I am trying to write a string to a varible, but the string contains '"'
>
>ie
>
>Dim MyString as String
>MyString='this is a test to "test"'
>
>
>VBA does not seem to like this
>
>
>So my question is how do I make a string of a sentence that already contains '"'
You can double the character as in:
? "this is a test to ""test""
You can also concatenate the ASCII character as in:
MyString="this is a test to " & chr$(34) & "test" & chr$(34)
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com