How to get quote marks in VBE NOT result in "end of statement"

D

Doug G

I have some code in a user form which requires the " mark to designate
inches. How do i make it not be interpreted as the "end of statement" ?
 
J

Jay Freedman

I have some code in a user form which requires the " mark to designate
inches. How do i make it not be interpreted as the "end of statement" ?

myString = "This " & chr(34) & " is a quote mark"

or

myString = "This " & """" & " is a quote mark"
 
J

Jonathan West

Jay Freedman said:
myString = "This " & chr(34) & " is a quote mark"

or

myString = "This " & """" & " is a quote mark"


or

myString = "This "" is a quote mark"
 
J

Jonathan West

Doug G said:
Where in my code do i insert this line described below?

Where you are defining the string that needs to contain the " character. The
examples are just examples demonstrating the principle. Hopefully you should
have no problem applyinng it to you case.

If you're still not sure, post bac the line of code where you are rting to
include the inch symbol, and Jay or I will edit it as appropriate
 
D

Doug G

Thanks for looking at this. It's the " mark after the 12

oVars("VarEntryDoor2").Value = "12" Sidelights And Transom If Shown On Plan"
 
J

Jay Freedman

Using Jonathan's example of using two quote marks to get one of them
into the string -- much the simplest way, and I keep forgetting about
it -- you would write

oVars("VarEntryDoor2").Value = "12"" Sidelights And Transom If Shown
On Plan"


--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top