Msgbox w/ multi-lines

  • Thread starter Thread starter jt46
  • Start date Start date
J

jt46

By using "Msgbox", I want to have multi-lines in 1 msg-box. Is thi
possible? Please help. Thanks.

Joh
 
Hi John

And yet another example:

Private Sub CommandButton1_Click()

Money = Format(10, "$##,##0.00")

MsgBox "Please bring " & vbLf & _
"a #2 Pencil " & vbCr & _
"a sheet of paper " & Chr(13) & _
"and " & Chr(13) & Chr(13) & _
"at Least " & vbTab & Money & _
" ! ", vbOKOnly, "Good Luck TK"
End Sub

Good Luck
TK
 
Use the vb constant vbcr for a carriage return or vbcrlf for a
carriage return with line feed
 
Sometimes Chr(13) etc don't work in VBA.

Better to use the VB constants such as VBcr or VBcrlf

Ths emove the pointer down to the next line and never fail that I know
of.
 
Use vbcr for carriage return or vbcrlf to put in a line feed.

Chr(13) does not always work however trhe vb constants do
 
the vb constant vbNewLine is designed to work both with the PC and the
MAC. since no one else has mentioned it . . . <g>
 
Another alternative would be to use vbnewline for example:

msgbox "I want to start a new line" & vbnewline & "here.
 
Try the following:

Dim intResponse As Integer

intResponse = MsgBox("Click Yes or No.", vbYesNo)
If intResponse = vbYes Then
MsgBox "You clicked Yes."
ElseIf intResponse = vbNo Then
MsgBox "You clicked No."
End If :
 

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