Help with putting 2 lines jof text in a MsgBox(resolved)
Hey,
I know this seems very elementary, but I can't get it to work!
Could someone help me with the technique of making the line of text in a messagebox (or InputBox) appear as two lines?
E.G. Msgbox "You must have the ABC Workbook open before proceeding!"
This would appear in the box as:
You must have the ABC Workbook open before proceeding!
I would like it to appear as:
You must have the ABC Workbook
open before proceeding!
I know I need to use the carriage return, but I don't know how to implement it.
Thank you for your help.
Don
Re: Help with putting 2 lines jof text in a MsgBox
Here you go :)
VB Code:
MsgBox "You must have the ABC Workbook" & vbCrLf & "open before proceeding!"
Re: Help with putting 2 lines jof text in a MsgBox
Thank you so much for the quick reply. This was reaally bugging me.
Thanks again.
Re: Help with putting 2 lines jof text in a MsgBox
You're welcome :)
Now that we've helped you, you can help us by editing the first post and adding the green checkmark. That indicates that you have your answer. You should also be aware (if you're not already) that you have the ability to rate a post if someone has been particularly helpful or even particularly unhelpful.
Re: Help with putting 2 lines jof text in a MsgBox(resolved)
What about Chr(10) fuction. Will it do the purpose?
I use Chr(10), but some times it works and sometimes it says not in the library error. how to use it??
Re: Help with putting 2 lines jof text in a MsgBox(resolved)
Chr(10) is a linefeed, Chr(13) is a carriage return. vbCrLf is both together. vbNewLine is another option.
Re: Help with putting 2 lines jof text in a MsgBox(resolved)
Straight out of the MSDN library:
Quote:
String expression displayed as the message in the dialog box. The maximum length of prompt is approximately 1024 characters, depending on the width of the characters used. If prompt consists of more than one line, you can separate the lines using a carriage return character (Chr(13)), a linefeed character (Chr(10)), or carriage return–linefeed character combination (Chr(13) & Chr(10)) between each line.