Return in a MsgBox Function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to force a return in my MsgBox function, to improve the
readability of the rather lenghty message. Is this possible?
 
msgbox "My Message is going to be too long to " & vbcrlf & "to fit on one
line"

it is normally better to create a string variable and make the long message
with the string and pass the string to it

e.g.


dim strMsg as string
strMsg = "My Message is going to be too long to " & vbcrlf & "to fit on one
line"

msgbox strMsg

should do the trick...
 
Yes...

Msgbox "This is line 1" + Chr(13) + "This is line 2" + Chr(13) + Chr(13) +
"This is lline 3 with an extra blank line before it"

The "Chr" includes the character of your choice --- 13 is the code for a
carriage return, line feed...

Bob.
 
Here some actual code:

MsgBox "You will need to move this msgbox out of " & vbCrLf & _
"the way to see the pbar in action." & vbCrLf & vbCrLf & _
"The timer bar can run independent " & vbCrLf & _
"of your code. You can also set " & vbCrLf & _
"the max value of the bar, and in. " & vbCrLf & _
" a code loop increment the bar by " & vbCrLf & _
" one increment each time." & vbCrLf & _
"If your loop is to 1000, then" & vbCrLf & _
"simply set the pmax = 1000, and" & vbCrLf & _
" call pinc for each loop. The amount" & vbCrLf & _
"of progress shown in bar is automatic" & vbCrLf & _
"" & vbCrLf & _
" Click ok to stop", vbInformation, "Progress bar demo"
 
Back
Top