Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm not sure about any speed advantage, but the purpose of vbNewLine is that
it is a platform (Windows or Mac) specific newline character or character sequence. That is, in Windows, vbNewLine is the same as vbCrLf; however, on a Mac, vbNewLine is the same as vbCr. That means if you are trying to inject a newline character sequence into a string of text, using vbNewLine relieves you of having to know what operating system your code will be run on. With that said, it is my understanding that the MessageBox statement will treat any of vbNewLine, vbCrLf, vbCr and vbLf all the same... as a newline character (sequence) no matter which operating system the code is run on. While the following link is directed at XL2000, the part described above is, again my understanding, universally applicable for the various Office products as well as the compiled version of VB. http://support.microsoft.com/kb/211774 Rick "Jon Peltier" wrote in message ... 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
To show a messagebox | Excel Discussion (Misc queries) | |||
messagebox help | Excel Programming | |||
messagebox help | Excel Programming | |||
multiline cells | Excel Programming | |||
Multiline Tooltip | Excel Programming |