+ Reply to Thread
Results 1 to 8 of 8

newline in a msgbox

  1. #1
    greenjellystar
    Guest

    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



  2. #2
    Bob Phillips
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    > 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
    >
    >




  3. #3
    Paul B
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    > 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
    >
    >




  4. #4
    James W.
    Guest

    RE: 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
    >
    >


  5. #5
    sebastienm
    Guest

    RE: 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
    >
    >


  6. #6
    Tom Ogilvy
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    > 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
    >
    >




  7. #7
    Zack Barresse
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    > 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
    >
    >




  8. #8
    greenjellystar
    Guest

    RE: 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
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1