MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Line break in a message box??

Posted by Ron on July 06, 2001 7:15 AM

Does anyone know how to add a line break in a message box? I would like to use a couple strings in a message box, but would like a line between them. I know I learned this once, but can't remember...
Thanks for any help!

Posted by Ron on July 06, 2001 7:20 AM

& vbCrLf & is my answer. Thanks.

Posted by faster on July 06, 2001 8:41 AM

Sub TEST()
'Chr(13) is a carriage return
'Chr(10) is a linefeed

MsgBox "TEXT" & Chr(13) & Chr(10) & "NEW LINE"
End Sub

Sub AnotherWay()
Dim MyRet
MyRet = Chr(13) & Chr(10)

MsgBox "TEXT" & MyRet & "NEW LINE" & MyRet & "LINE THREE"

End Sub