![]() |
newline in a msgbox
hello...i can't get my msgbox to display multiple lines...can someone help me
with this...my code is below... Worksheets("Sup 31xx").Range("M13").Formula = "='Sup 31xx'!$L$10+'Sup 32xx'!$L$10+'Sup 39xx'!$L$10+'Sup 4xxx'!$L$10" Dim cat cat = Worksheets("Sup 31xx").Range("M13") MsgBox "The categorical total for SUPPLIES is: " & cat & " Have a great day!", vbOKOnly, "Category Total for SUPPLIES" thanks and have a great one, jessie :) |
newline in a msgbox
MsgBox "The categorical total for SUPPLIES is: " & vbCrLf & )
cat &vbCrLf & " Have a great day!", vbOKOnly, "Category Total for SUPPLIES -- HTH Bob Phillips "greenjellystar" wrote in message ... hello...i can't get my msgbox to display multiple lines...can someone help me with this...my code is below... Worksheets("Sup 31xx").Range("M13").Formula = "='Sup 31xx'!$L$10+'Sup 32xx'!$L$10+'Sup 39xx'!$L$10+'Sup 4xxx'!$L$10" Dim cat cat = Worksheets("Sup 31xx").Range("M13") MsgBox "The categorical total for SUPPLIES is: " & cat & " Have a great day!", vbOKOnly, "Category Total for SUPPLIES" thanks and have a great one, jessie :) |
newline in a msgbox
greenjellystar,
MsgBox "First Line" & vbCrLf & "Second Line" -- Paul B Always backup your data before trying something new Please post any response to the newsgroups so others can benefit from it Feedback on answers is always appreciated! Using Excel 2002 & 2003 "greenjellystar" wrote in message ... hello...i can't get my msgbox to display multiple lines...can someone help me with this...my code is below... Worksheets("Sup 31xx").Range("M13").Formula = "='Sup 31xx'!$L$10+'Sup 32xx'!$L$10+'Sup 39xx'!$L$10+'Sup 4xxx'!$L$10" Dim cat cat = Worksheets("Sup 31xx").Range("M13") MsgBox "The categorical total for SUPPLIES is: " & cat & " Have a great day!", vbOKOnly, "Category Total for SUPPLIES" thanks and have a great one, jessie :) |
newline in a msgbox
use chr(10)...
example msgbox "This is the first line" & chr(10) _ & "This is the second line" "greenjellystar" wrote: hello...i can't get my msgbox to display multiple lines...can someone help me with this...my code is below... Worksheets("Sup 31xx").Range("M13").Formula = "='Sup 31xx'!$L$10+'Sup 32xx'!$L$10+'Sup 39xx'!$L$10+'Sup 4xxx'!$L$10" Dim cat cat = Worksheets("Sup 31xx").Range("M13") MsgBox "The categorical total for SUPPLIES is: " & cat & " Have a great day!", vbOKOnly, "Category Total for SUPPLIES" thanks and have a great one, jessie :) |
newline in a msgbox
Hi,
Try with the vbNewline constant, something like: MsgBox "First line" & vbNewLine & "Second line" -- Regards, Sébastien "greenjellystar" wrote: hello...i can't get my msgbox to display multiple lines...can someone help me with this...my code is below... Worksheets("Sup 31xx").Range("M13").Formula = "='Sup 31xx'!$L$10+'Sup 32xx'!$L$10+'Sup 39xx'!$L$10+'Sup 4xxx'!$L$10" Dim cat cat = Worksheets("Sup 31xx").Range("M13") MsgBox "The categorical total for SUPPLIES is: " & cat & " Have a great day!", vbOKOnly, "Category Total for SUPPLIES" thanks and have a great one, jessie :) |
newline in a msgbox
MsgBox "The categorical total for SUPPLIES is: " & _
vbNewLine & cat & vbNewline & _ " Have a great day!", vbOKOnly, "Category Total for SUPPLIES" Other constants that will work in Windows vbCrLf vbCr vbLf But vbNewLine is better for compatibility with the Mac. -- Regards, Tom Ogilvy "greenjellystar" wrote in message ... hello...i can't get my msgbox to display multiple lines...can someone help me with this...my code is below... Worksheets("Sup 31xx").Range("M13").Formula = "='Sup 31xx'!$L$10+'Sup 32xx'!$L$10+'Sup 39xx'!$L$10+'Sup 4xxx'!$L$10" Dim cat cat = Worksheets("Sup 31xx").Range("M13") MsgBox "The categorical total for SUPPLIES is: " & cat & " Have a great day!", vbOKOnly, "Category Total for SUPPLIES" thanks and have a great one, jessie :) |
newline in a msgbox
Hello Jessie,
I see a plethora of good examples. I prefer the vbNewLine, as stated, for compatability/cross-platform issues. Plus it's just easier to read and understand. One thing I generally do in my spreadsheets is in one (or a central) Module, I will put this as a global constant ... Public Const NL As string = vbNewline Public Const DNL As string = vbNewline & vbNewLine Then when I want a space I can use the NL constant, or the DNL constant for a double new line. A MsgBox might then look like this ... MsgBox "Hello!" & DNL & "How are you?" & NL & "Are you Ok?", vbYesNo, "Check Me" -- Regards, Zack Barresse, aka firefytr "greenjellystar" wrote in message ... hello...i can't get my msgbox to display multiple lines...can someone help me with this...my code is below... Worksheets("Sup 31xx").Range("M13").Formula = "='Sup 31xx'!$L$10+'Sup 32xx'!$L$10+'Sup 39xx'!$L$10+'Sup 4xxx'!$L$10" Dim cat cat = Worksheets("Sup 31xx").Range("M13") MsgBox "The categorical total for SUPPLIES is: " & cat & " Have a great day!", vbOKOnly, "Category Total for SUPPLIES" thanks and have a great one, jessie :) |
newline in a msgbox
Thanks to everyone...it worked...wahoo
:) "greenjellystar" wrote: hello...i can't get my msgbox to display multiple lines...can someone help me with this...my code is below... Worksheets("Sup 31xx").Range("M13").Formula = "='Sup 31xx'!$L$10+'Sup 32xx'!$L$10+'Sup 39xx'!$L$10+'Sup 4xxx'!$L$10" Dim cat cat = Worksheets("Sup 31xx").Range("M13") MsgBox "The categorical total for SUPPLIES is: " & cat & " Have a great day!", vbOKOnly, "Category Total for SUPPLIES" thanks and have a great one, jessie :) |
All times are GMT +1. The time now is 10:29 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com