View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jon Peltier Jon Peltier is offline
external usenet poster
 
Posts: 6,582
Default Multiline Messagebox in VBA

I read recently that vbNewLine was slightly faster than vbCrLf. vbCr and
vbLf may not give the same results.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Rick Rothstein (MVP - VB)" wrote in
message ...
Simply use one of the built-in VBA constants to move to the next line....

MsgBox "Some text" & vbNewLine & "More text"

or...

MsgBox "Some text" & vbCrLf & "More text"

or even....

MsgBox "Some text" & vbLf & "More text"

or even....

MsgBox "Some text" & vbCr & "More text"

VBA seems to be tolerant of almost anything that says 'go to another
line'.

Rick


"Joe" wrote in message
...
Hi all,

I wanted a Multiline Messagebox in VBA.
I tried the following code but an error ("Object Required") comes.

MsgBox ("Some text" & ControlChars.NewLine & "More text")
Is it because of the .newline? How can I get a multiline msgbox?

mine is excel 2003 (SP2)


Thanks
Joe