Message Box Force new line

hullstorage

Registered User.
Local time
Today, 18:03
Joined
Jul 18, 2007
Messages
213
Hi all,

How do i force a newline in my message in the message box funtion

i.e. message would show like this

Hello World
Welcome to my World
How is yours

Thanks all
 
Code:
MsgBox "Hello World" & vbCrLf & "Welcome to my World" & vbCrLf & "How is yours"

or you can use

Chr(13) & Chr(10)

instead of the vbCrLf constant (although I like that one better as it is less typing :D )
 
Hi all,

How do i force a newline in my message in the message box funtion

i.e. message would show like this

Hello World
Welcome to my World
How is yours

Thanks all

If the MsgBox is in VB Coding, then add vbCrLf to the line
Code:
    MyMessage= MsgBox "Hello World" & vbCrLf & "Welcome to my World" & vbCrLf & "How is yours"

UPDATE:

Do What BobLarson Said. I was too slow, and he beat me to it again. I would like to add that if you are using macros, and not VB Code, then Chr(13) & Chr(10) will be way to go.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom