Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Multiple Lines in Message Boxes

Mike,
If you are concerned about a Mac (or some other platform), vbNewLine is the
way to go, because it evaluates to what the system expects .
So on Windows it is vbCrLf but (apparently) vbCr on a Mac.
But it will be correct on either.

NickHK

"Mike Woodhouse" wrote in message
ups.com...


On Nov 14, 4:31 am, "NickHK" wrote:
Msg = "Step 1: do this" & vbNewLine & "Step 2: do that"
MsgBox Msg

NickHK

"amacdoc" wrote in

...

Can anyone tell me how to get multiple lines in the prompt section of

Message
boxes?
VB help mentions carriage return characters chr(13) but i cant work

out
how
to use them.
Currently i have a line of code that says:
Msg = Step 1: do this, Step 2: do that
i am trying to get step 1 and step 2 on different lines


All these seem to work. If you're on a Mac, or remotely concerned about
Mac compatibility, it looks like vbNewLine is the way to go...

Public Sub MsgBoxes()

MsgBox "a" & Chr(13) & "b"
MsgBox "a" & Chr(10) & "b"
MsgBox "a" & vbCrLf & "b"
MsgBox "a" & vbCr & "b"
MsgBox "a" & vbLf & "b"
MsgBox "a" & vbNewLine & "b" ' Same as vbCrLf on Windows (13+10)
but just Chr(13) on Mac

End Sub


Mike



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding Lines And Boxes, etc. To A Chart ? Robert11[_3_] Charts and Charting in Excel 5 October 17th 09 08:13 PM
In Excel 2007 chart with multiple lines, mouse doesn't track lines sfuelling Charts and Charting in Excel 1 August 19th 09 09:41 PM
Displaying Multiple values with message boxes Dani Excel Programming 1 January 10th 06 11:41 PM
Message Boxes. mika.[_2_] Excel Programming 1 November 19th 03 12:17 AM
Multiple lines in a Message box mandy_less Excel Programming 0 September 22nd 03 05:08 AM


All times are GMT +1. The time now is 06:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"