Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Software Development Software Development
Search Search
Search for:
Tech Support Guy > > >

Solved: Carriage return character in VBA


(!)

drawde's Avatar
drawde drawde is offline
Member with 18 posts.
THREAD STARTER
 
Join Date: Jul 2006
Location: England
Experience: Intermediate/Advanced
10-Aug-2006, 08:49 AM #1
Solved: Carriage return character in VBA
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's Avatar
OBP OBP is offline OBP is a Trusted Advisor with special permissions.
Computer Specs
Trusted Advisor with 18,667 posts.
 
Join Date: Mar 2005
Location: UK
10-Aug-2006, 10:01 AM #2
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's Avatar
drawde drawde is offline
Member with 18 posts.
THREAD STARTER
 
Join Date: Jul 2006
Location: England
Experience: Intermediate/Advanced
13-Aug-2006, 02:42 PM #3
worked a treat! thanks!
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
WELCOME TO TECH SUPPORT GUY!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.


(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑

Content Relevant URLs by vBSEO 3.3.2