ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Is Multi line possible with MsgBox (https://www.excelbanter.com/excel-programming/396929-multi-line-possible-msgbox.html)

Ayo

Is Multi line possible with MsgBox
 
Is it possible to have this in multiple lines, instead of just one single line?

MsgBox "An Error as occurred in the Save file to folder. This Macro will now
TERMINATED"


[email protected]

Is Multi line possible with MsgBox
 
On Sep 5, 4:32 pm, Ayo wrote:
Is it possible to have this in multiple lines, instead of just one single line?

MsgBox "An Error as occurred in the Save file to folder. This Macro will now
TERMINATED"


The string chr(13) will provide a carriage return. For example

MsgBox "An Error as occurred in the Save file to folder." & chr(13) &
"This Macro will now
TERMINATED"




Chip Pearson

Is Multi line possible with MsgBox
 
Try

MsgBox "Line One" & vbCrLf & _
"Line Two"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)

"Ayo" wrote in message
...
Is it possible to have this in multiple lines, instead of just one single
line?

MsgBox "An Error as occurred in the Save file to folder. This Macro will
now
TERMINATED"



Vergel Adriano

Is Multi line possible with MsgBox
 
example:

MsgBox "Line 1" & vbNewLine & "Line 2"


--
Hope that helps.

Vergel Adriano


"Ayo" wrote:

Is it possible to have this in multiple lines, instead of just one single line?

MsgBox "An Error as occurred in the Save file to folder. This Macro will now
TERMINATED"


Rick Rothstein \(MVP - VB\)

Is Multi line possible with MsgBox
 
Is it possible to have this in multiple lines, instead of just one single
line?

MsgBox "An Error as occurred in the Save file to folder. This Macro will
now
TERMINATED"


The string chr(13) will provide a carriage return. For example

MsgBox "An Error as occurred in the Save file to folder." & chr(13) &
"This Macro will now
TERMINATED"


Or, you can use the built-in VB constant for carriage returns, vbCr...

MsgBox "An Error as occurred in the Save file to folder." & vbCr & "This
Macro will now TERMINATED"

If you want a blank line between the sentences for visual looks reasons, use
two vbCr characters...

MsgBox "An Error as occurred in the Save file to folder." & vbCr & vbCr &
"This Macro will now TERMINATED"

Note: I'm sure your newsreader will split the above lines into more than one
line, but they are just single code lines.

Rick



All times are GMT +1. The time now is 03:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com