ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   General Message Box Question (https://www.excelbanter.com/excel-programming/330321-general-message-box-question.html)

EMoe[_13_]

General Message Box Question
 

Whenever you prompt a message box, using this format:

returnvalue = MsgBox("Did you remember to log in your
name?",64,"Message")

If I had a long statement or wanted to add a second sentence, is it
possible
(or how do you), continue or put the second sentenceon another line?

Or does excel just place everything on one line?

Thanks,
EMoe


--
EMoe
------------------------------------------------------------------------
EMoe's Profile: http://www.excelforum.com/member.php...o&userid=23183
View this thread: http://www.excelforum.com/showthread...hreadid=374589


Tom Ogilvy

General Message Box Question
 
Sub a()
msg = "line1" & vbNewLine & "Line2"
returnvalue = MsgBox(msg, 64, "title")
End Sub


--
Regards,
Tom Ogilvy




"EMoe" wrote in message
...

Whenever you prompt a message box, using this format:

returnvalue = MsgBox("Did you remember to log in your
name?",64,"Message")

If I had a long statement or wanted to add a second sentence, is it
possible
(or how do you), continue or put the second sentenceon another line?

Or does excel just place everything on one line?

Thanks,
EMoe


--
EMoe
------------------------------------------------------------------------
EMoe's Profile:

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




Chip Pearson

General Message Box Question
 
Use vbNewLine to break text up in to multiple lines. E.g.,

MsgBox "Line one" & vbNewLine & "Line two"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"EMoe" wrote
in message
...

Whenever you prompt a message box, using this format:

returnvalue = MsgBox("Did you remember to log in your
name?",64,"Message")

If I had a long statement or wanted to add a second sentence,
is it
possible
(or how do you), continue or put the second sentenceon another
line?

Or does excel just place everything on one line?

Thanks,
EMoe


--
EMoe
------------------------------------------------------------------------
EMoe's Profile:
http://www.excelforum.com/member.php...o&userid=23183
View this thread:
http://www.excelforum.com/showthread...hreadid=374589




dominicb[_9_]

General Message Box Question
 

Good evening Emoe

There are two ways of doing it, both demostrated in this macro. Take
your pick.

Sub example()
MsgBox "This is line 1" & vbLf & "This is line 2" _
& Chr(13) & "This is line 3"
End Sub

HTH

DominicB


--
dominicb
------------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932
View this thread: http://www.excelforum.com/showthread...hreadid=374589


EMoe[_14_]

General Message Box Question
 

It works!!! Thanks a bunch.

Regards,
EMoe


--
EMoe
------------------------------------------------------------------------
EMoe's Profile: http://www.excelforum.com/member.php...o&userid=23183
View this thread: http://www.excelforum.com/showthread...hreadid=374589


dominicb[_10_]

General Message Box Question
 

Hi Emoe

No problem, I appreciate the feedback.

However, it seem that our questions posts are now duplicated on the
Microsoft site, but (judging from the response) not the answers
posted!

DominicB


--
dominicb
------------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932
View this thread: http://www.excelforum.com/showthread...hreadid=374589



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

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