# Solved: Carriage return character in VBA



## drawde

THis is probably a very stupid question, but I have just begun teaching myself VBA in Microsoft Office 2003.

I am trying to use the MsgBox function in Word to display a message box, however I need to make the message run over two lines of text. The help file says "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 a carriage return - linefeed character combination (*Chr(*13*)* & *Chr(*10*)*) between each line.

This means nothing to me - I have experimented with typing (Chr(13) within my text, but it just displays this in my message box text.

Can anyone clarify what I have to type, or give me an example of what it should look like?

Thanks

drawde


----------



## OBP

The ASCII characters have to be included in your text but outside of any quote marks, so to include a return in your text you need something like this
"this bit is text" & CHR$(13) & "this bit is more text"


----------



## drawde

worked a treat! thanks!


----------

