Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default Multiple lines desired in Msgbox

Hi - I'm trying to have multiple lines of text appear in my message box but
can't figure out how to do this. Basically, I'd like my Msgbox to display,
for example, the following text:

"Hi! Thanks for using this spreadsheet.
My name is Rob and I hope you find this useful.
Please contact me if you have any problems!"

Basically, I literally want to have this on three lines. Currently I have
the following code but can't figure out how to get this message on three
lines. I've tried to insert chr(13), hoping that would move the desired text
to the next line, but I haven't been able to figure out the proper syntax.
Thx!

MsgBox "Hi! Thanks for using this spreadsheet. My name is Rob and I hope
you find this useful. Please contact me if you have any problems!"



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default Multiple lines desired in Msgbox

MsgBox "Hi! Thanks for using this spreadsheet." & VbNewLine & _
"My name is Rob and I hope you find this useful." & VbNewLine & _
"Please contact me if you have any problems!"

HTH. Best wishes Harald

"Linking to specific cells in pivot table"
crosoft.com skrev i
melding ...
Hi - I'm trying to have multiple lines of text appear in my message box

but
can't figure out how to do this. Basically, I'd like my Msgbox to

display,
for example, the following text:

"Hi! Thanks for using this spreadsheet.
My name is Rob and I hope you find this useful.
Please contact me if you have any problems!"

Basically, I literally want to have this on three lines. Currently I have
the following code but can't figure out how to get this message on three
lines. I've tried to insert chr(13), hoping that would move the desired

text
to the next line, but I haven't been able to figure out the proper syntax.
Thx!

MsgBox "Hi! Thanks for using this spreadsheet. My name is Rob and I hope
you find this useful. Please contact me if you have any problems!"





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 121
Default Multiple lines desired in Msgbox

I find CHR(13) works beautifully too -- I have never seen it fail to drop a
line. Has anyone seen it not work?


"Harald Staff" wrote in message
...
MsgBox "Hi! Thanks for using this spreadsheet." & VbNewLine & _
"My name is Rob and I hope you find this useful." & VbNewLine & _
"Please contact me if you have any problems!"

HTH. Best wishes Harald

"Linking to specific cells in pivot table"
crosoft.com skrev i
melding ...
Hi - I'm trying to have multiple lines of text appear in my message box

but
can't figure out how to do this. Basically, I'd like my Msgbox to

display,
for example, the following text:

"Hi! Thanks for using this spreadsheet.
My name is Rob and I hope you find this useful.
Please contact me if you have any problems!"

Basically, I literally want to have this on three lines. Currently I
have
the following code but can't figure out how to get this message on three
lines. I've tried to insert chr(13), hoping that would move the desired

text
to the next line, but I haven't been able to figure out the proper
syntax.
Thx!

MsgBox "Hi! Thanks for using this spreadsheet. My name is Rob and I
hope
you find this useful. Please contact me if you have any problems!"







  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default Multiple lines desired in Msgbox

William,

This gives a pretty good overview of all your options:
http://support.microsoft.com/?kbid=211774

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 121
Default Multiple lines desired in Msgbox

Thanks Nick ...
The list there says

vbNewLine A platform-specific new line character, either [Chr(13) +
Chr(10)] or [Chr(13)]

so ... are there platforms where the former is required? I have never used
chr(10).


"Nick Hebb" wrote in message
oups.com...
William,

This gives a pretty good overview of all your options:
http://support.microsoft.com/?kbid=211774





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default Multiple lines desired in Msgbox

On Windows VbCrLf is equivalent to VbNewLine, so every time that you've
used either one you've implicitly used chr(10) - line feed.

I imagine that the other systems that use only chr(13) - carraige
return - would primarily be Macs.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default Multiple lines desired in Msgbox

This is slightly off topic, but if you ever want to wrap text in a
cell, use VbLf to pick the exact position where you want the line
break. Using VbNewLine or VbCrLf will insert the line break but also
display a little black square. I only mention it because I wasted
longer than I want to admit trying to figure that out one day.

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
MsgBox text on several lines mohavv Excel Discussion (Misc queries) 1 November 21st 07 08:17 PM
Msgbox w/ multi-lines jt46 Excel Programming 11 October 11th 04 08:55 AM
MsgBox With Multiple Lines? ianripping[_49_] Excel Programming 2 April 20th 04 11:41 AM
Using different lines in an input- or msgbox Syrus the Virus[_16_] Excel Programming 3 March 2nd 04 12:35 PM
Multiple lines in MsgBox NJF Excel Programming 3 January 13th 04 01:50 PM


All times are GMT +1. The time now is 02:00 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"