MsgBox line break

  • Thread starter Horatio J. Bilge, Jr.
  • Start date
H

Horatio J. Bilge, Jr.

I would like to add a line break to a message box. The VBA help file for
MsgBox says you can use a carriage return character (CHR(13)) or linefeed
character (Chr(10)), but I can't figure out how to use them.

What I have is something like this:

MsgBox("This is line #1"Chr(13)"This is line #2")

but this give me an error "Compile error: Syntax error"

Thanks for any help,
~ Horatio
 
H

Horatio J. Bilge, Jr.

Thank you.

Dave Peterson said:
MsgBox "This is line #1" & vblf & "This is line #2"
or
MsgBox "This is line #1" & chr(10) & "This is line #2"
or
MsgBox "This is line #1" & vbnewline & "This is line #2"
 
Top