Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HELP PLEASE! How to put double quotes in string

Status
Not open for further replies.
Jan 8, 2001
163
US
I know this is probably an easy question but how do I get VB to include double quotes in a string variable. Like say strA is supposed to display " She said, "I did it!" ". How do I get VB to see the double quotes as double quotes rather than the end of the string variable. This should be easy but since I'm fairly new to VB it's not something I've stumbled upon yet.

Thanks in Advance,
CrystalVisualBOracle
 
'"' & MyString & '"' is how you do it with VBA.

 
Great! That was even easier than I thought it would be. Two double quotes next to each other automatically become one single quote in the string. Thanks a lot! richardii! :eek:)

CrystalVisualBOracle
 
Two double quotes next to each other becomes ONE double quote.

Alternatively, and more work, you could use:

strA = "She said, " & Chr(34) & "I did it!" & Chr(34) & "."
Simon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top