ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Msgbox w/ multi-lines (https://www.excelbanter.com/excel-programming/313044-msgbox-w-multi-lines.html)

jt46

Msgbox w/ multi-lines
 

By using "Msgbox", I want to have multi-lines in 1 msg-box. Is thi
possible? Please help. Thanks.

Joh

--
jt4
-----------------------------------------------------------------------
jt46's Profile: http://www.excelforum.com/member.php...fo&userid=1515
View this thread: http://www.excelforum.com/showthread.php?threadid=26786


soniya

Msgbox w/ multi-lines
 
Hi John

MsgBox "Line1" & Chr(13) & "line2" & Chr(13) & "Line3"


-----Original Message-----

By using "Msgbox", I want to have multi-lines in 1 msg-

box. Is this
possible? Please help. Thanks.

John


--
jt46
---------------------------------------------------------

---------------
jt46's Profile: http://www.excelforum.com/member.php?

action=getinfo&userid=15154
View this thread:

http://www.excelforum.com/showthread...hreadid=267861

.


Geof Wyght[_2_]

Msgbox w/ multi-lines
 
The alternative to Soniya's is to use vbCrLf instead of
Chr(13).
Geof.
-----Original Message-----

By using "Msgbox", I want to have multi-lines in 1 msg-

box. Is this
possible? Please help. Thanks.

John


--
jt46
---------------------------------------------------------

---------------
jt46's Profile: http://www.excelforum.com/member.php?

action=getinfo&userid=15154
View this thread:

http://www.excelforum.com/showthread...hreadid=267861

.


TK

Msgbox w/ multi-lines
 
Hi John

And yet another example:

Private Sub CommandButton1_Click()

Money = Format(10, "$##,##0.00")

MsgBox "Please bring " & vbLf & _
"a #2 Pencil " & vbCr & _
"a sheet of paper " & Chr(13) & _
"and " & Chr(13) & Chr(13) & _
"at Least " & vbTab & Money & _
" ! ", vbOKOnly, "Good Luck TK"
End Sub

Good Luck
TK


-----Original Message-----

By using "Msgbox", I want to have multi-lines in 1 msg-

box. Is this
possible? Please help. Thanks.

John


--
jt46
---------------------------------------------------------

---------------
jt46's Profile: http://www.excelforum.com/member.php?

action=getinfo&userid=15154
View this thread:

http://www.excelforum.com/showthread...hreadid=267861

.



Degsyb

Msgbox w/ multi-lines
 
Use the vb constant vbcr for a carriage return or vbcrlf for a
carriage return with line feed


On Sat, 9 Oct 2004 05:04:13 -0700, "Soniya"
wrote:

Hi John

MsgBox "Line1" & Chr(13) & "line2" & Chr(13) & "Line3"


-----Original Message-----

By using "Msgbox", I want to have multi-lines in 1 msg-

box. Is this
possible? Please help. Thanks.

John


--
jt46
---------------------------------------------------------

---------------
jt46's Profile: http://www.excelforum.com/member.php?

action=getinfo&userid=15154
View this thread:

http://www.excelforum.com/showthread...hreadid=267861

.



Degsyb

Msgbox w/ multi-lines
 
It's better to use the VBA constants such as VBcr or VBcrlf


On Sat, 9 Oct 2004 05:04:13 -0700, "Soniya"
wrote:

Hi John

MsgBox "Line1" & Chr(13) & "line2" & Chr(13) & "Line3"


-----Original Message-----

By using "Msgbox", I want to have multi-lines in 1 msg-

box. Is this
possible? Please help. Thanks.

John


--
jt46
---------------------------------------------------------

---------------
jt46's Profile: http://www.excelforum.com/member.php?

action=getinfo&userid=15154
View this thread:

http://www.excelforum.com/showthread...hreadid=267861

.



Degsyb

Msgbox w/ multi-lines
 
On Sat, 9 Oct 2004 05:04:13 -0700, "Soniya"
wrote:

Hi John

MsgBox "Line1" & Chr(13) & "line2" & Chr(13) & "Line3"


-----Original Message-----

By using "Msgbox", I want to have multi-lines in 1 msg-

box. Is this
possible? Please help. Thanks.

John


--
jt46
---------------------------------------------------------

---------------
jt46's Profile: http://www.excelforum.com/member.php?

action=getinfo&userid=15154
View this thread:

http://www.excelforum.com/showthread...hreadid=267861

.



Degsyb

Msgbox w/ multi-lines
 
Sometimes Chr(13) etc don't work in VBA.

Better to use the VB constants such as VBcr or VBcrlf

Ths emove the pointer down to the next line and never fail that I know
of.

On Sat, 9 Oct 2004 05:04:13 -0700, "Soniya"
wrote:

Hi John

MsgBox "Line1" & Chr(13) & "line2" & Chr(13) & "Line3"


-----Original Message-----

By using "Msgbox", I want to have multi-lines in 1 msg-

box. Is this
possible? Please help. Thanks.

John


--
jt46
---------------------------------------------------------

---------------
jt46's Profile: http://www.excelforum.com/member.php?

action=getinfo&userid=15154
View this thread:

http://www.excelforum.com/showthread...hreadid=267861

.



Degsyb

Msgbox w/ multi-lines
 
Use vbcr for carriage return or vbcrlf to put in a line feed.

Chr(13) does not always work however trhe vb constants do

On Sat, 9 Oct 2004 05:04:13 -0700, "Soniya"
wrote:

Hi John

MsgBox "Line1" & Chr(13) & "line2" & Chr(13) & "Line3"


-----Original Message-----

By using "Msgbox", I want to have multi-lines in 1 msg-

box. Is this
possible? Please help. Thanks.

John


--
jt46
---------------------------------------------------------

---------------
jt46's Profile: http://www.excelforum.com/member.php?

action=getinfo&userid=15154
View this thread:

http://www.excelforum.com/showthread...hreadid=267861

.



Tom Ogilvy

Msgbox w/ multi-lines
 
the vb constant vbNewLine is designed to work both with the PC and the
MAC. since no one else has mentioned it . . . <g

--
Regards,
Tom Ogilvy

"jt46" wrote in message
...

By using "Msgbox", I want to have multi-lines in 1 msg-box. Is this
possible? Please help. Thanks.

John


--
jt46
------------------------------------------------------------------------
jt46's Profile:

http://www.excelforum.com/member.php...o&userid=15154
View this thread: http://www.excelforum.com/showthread...hreadid=267861




uecem

Msgbox w/ multi-lines
 

Another alternative would be to use vbnewline for example:

msgbox "I want to start a new line" & vbnewline & "here.

--
uece
-----------------------------------------------------------------------
uecem's Profile: http://www.excelforum.com/member.php...fo&userid=1513
View this thread: http://www.excelforum.com/showthread.php?threadid=26786


uecem[_3_]

Msgbox w/ multi-lines
 

Try the following:

Dim intResponse As Integer

intResponse = MsgBox("Click Yes or No.", vbYesNo)
If intResponse = vbYes Then
MsgBox "You clicked Yes."
ElseIf intResponse = vbNo Then
MsgBox "You clicked No."
End If :

--
uece
-----------------------------------------------------------------------
uecem's Profile: http://www.excelforum.com/member.php...fo&userid=1513
View this thread: http://www.excelforum.com/showthread.php?threadid=26786



All times are GMT +1. The time now is 08:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com