Message Boxes

  • Thread starter Thread starter Mikey May
  • Start date Start date
M

Mikey May

When displaying a message box how do you insert rows,
carriage returns and place bullit points on left hand side
of box.

I've seen how to do it somewhere and I know it's dead
simple but can't remember where!!!


Thanx all!!!
 
Mikey,

Use the concatenate operator, &, with the Chr(10) (line feed) code:

MsgBox "First line" & chr(10) & "Second line"

To keep the code cleaner-looking, you may want to use the form:

MsgBox "This is the first line" & Chr(10) & _
"This is the second" & Chr(10) & _
"And the final line", vbCritical
 
Try this Mikey

Sub test()
MsgBox "Hi:" _
& vbCrLf & vbCrLf & _
"this is line 1." & vbCrLf & _
"this is line 2." & vbCrLf & _
"this is line 3." & vbCrLf & vbCrLf & _
"Goodby.", vbOKOnly, "MyMSGBOX"
End Sub
 
Sub test()
MsgBox (Chr(149) & "This example" & Chr(10) & _
"should help" & Chr(10) & Chr(10) & "you")
End Sub

HTH
Jason
Atlanta, GA
 
A carriage return in a message box is inserted using vbCr or Chr(13). An
empty space between two lines of text would be vbCr & vbCr. Tabs are vbTab
or Chr(9). Bullets are Chr(XX), where "XX" is the character number of the
bullet you want to use. The message boxes (I believe) use the font set in
your Windows settings for "Message Box" (right-click on desktop, select
Properties>Appearance; click on Message Text and see what font name come
up). You can then use the Insert Symbol function in Word - set it to the
font name you just found and run through the characters; their number code
is displayed in the Status Bar.

HTH
Ed
 
Back
Top