Quotes around text in Msgbox

  • Thread starter Thread starter davegb
  • Start date Start date
D

davegb

I searched this forum but couldn't find the same situation. I want to
have quotes around some text in other text in a Msgbox. I want the
text in the Msgbox to read,
Question 2 is answered "Other, Please specify" but there is no text in
the adjacent cell. Please enter the data there.
..

I've tried a couple of combinations, the last being:
MsgBox "Question 2 is answered" & ""Other, Please specify"" & "but
there is no text in the adjacent cell. Please enter the data there."

How do I get the quotes in the message box text?

As always, thanks!
 
Try this:

MsgBox "Question 2 is answered " & """Other, Please specify"""
& " but there is no text in the adjacent cell. Please enter the data there."

Does that help?
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)
 
I searched this forum but couldn't find the same situation. I want to
have quotes around some text in other text in a Msgbox. I want the
text in the Msgbox to read,
Question 2 is answered "Other, Please specify" but there is no text in
the adjacent cell. Please enter the data there.
.

I've tried a couple of combinations, the last being:
MsgBox "Question 2 is answered" & ""Other, Please specify"" & "but
there is no text in the adjacent cell. Please enter the data there."

How do I get the quotes in the message box text?

As always, thanks!

You can directly enter the ascii code for ", which is 34
if you want the box to say: "hello"
then put the following: Msgbox Chr(34) & "hello" & Chr(34)
 
or...this:

MsgBox "Question 2 is answered ""Other, Please specify"" but there is
no text in the adjacent cell. Please enter the data there."

--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)
 
Just use three " where you have two and it should work

MsgBox "Question 2 is answered" & """ Other, Please specify """ & "but etc etc
 
Try this:

MsgBox "Question 2 is answered " & """Other, Please specify"""
& " but there is no text in the adjacent cell. Please enter the data there.."

Does that help?
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)









- Show quoted text -

Hey, what took you guys so long? I posted almost 5 min ago. :)
Thanks for both replies. Problem solved, and in 5 min!
 
I searched this forum but couldn't find the same situation. I want to
have quotes around some text in other text in a Msgbox. I want the
text in the Msgbox to read,
Question 2 is answered "Other, Please specify" but there is no text in
the adjacent cell. Please enter the data there.
.

I've tried a couple of combinations, the last being:
MsgBox "Question 2 is answered" & ""Other, Please specify"" & "but
there is no text in the adjacent cell. Please enter the data there."

How do I get the quotes in the message box text?

As always, thanks!
----------------------------------

The easy, "cheating" solution is to use single quotes in your message
rather than double. i.e. 'Other, Please specify.'

Bill
 

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

Back
Top