msgbox Question

D

dok112

I am having a serious lapse of knowledge right now...

How do I make a msgbox have multiple lines of text instead of one
ongoing line.

ex.
msg = "Q1: ------------------------------" & _
"Q2: ------------------------------"
style = vbokonly
title = Test"

msgbox msg, style, title

When I do this, I get Q1: ----------------- Q2:---------------- and I
need them on 2 lines.
 
J

JakeyC

Use the concatenate operator '&' to include Chr(10) in your string of
text.

ie MsgBox ("Hello there" & Chr(10) & "How are you")
should display:

Hello there
How are you

Chr(10) works a little like someone having pressed Return mid-sentence.
 
L

Leith Ross

Hello Dok112,

Add a Carraige Return Line Feed to the end of of line to start a new
one...

msg = "Q1: ------------------------------" & vbCrLf & _
"Q2: ------------------------------"
style = vbokonly
title = Test"


This will give you 2 lines.

Sincerely,
Leith Ross
 

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

Similar Threads


Top