+ Reply to Thread
Results 1 to 7 of 7

Adding multiple rows of text in a Msgbox.!

Hybrid View

  1. #1
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Adding multiple rows of text in a Msgbox.!

    Hi Forum.!

    I believe this would be a very simple query for some but I am a complete novice in VBa and am using a msgbox in one of my file but I need to split the message text into multiple lines but I do not know how to do the same..

    Can someone please guide me ?
    Last edited by dominicb; 10-07-2009 at 11:39 AM.

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile Re: Adding multiple rows of text in a Msgbox.!

    Good afternoon e4excel
    [QUOTE=e4excel;2176431]am using a msgbox in one of my file but I need to split the message text into multiple lines QUOTE]
    MsgBox "Line1" & Chr(13) & "Line2" & Chr(13) & "Line3"
    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  3. #3
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Adding multiple rows of text in a Msgbox.!

    Hi! Dominic

    and a very good afternoon to you....By the way its a lovely evening out here....

    It worked very well, and it looks fine...
    Just wanted to know confirm that chr(13) is equivalent to Enter ",<__l "

    and also in the VBA Modules window, is there a way of writing the code in the next line...for the same line as in this case the Msgbox text was going beyond the normal viewable portion.

    Thanks a lot for the help..!

    I am not able to mark this thread as solved as am not getting the option prefix after going in EDIT->Go Advanced.. kIndly guide me for the same as well..
    Last edited by e4excel; 10-07-2009 at 11:20 AM. Reason: spelling mistake

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Adding multiple rows of text in a Msgbox.!

        MsgBox "Line1" & Chr(10) _
             & "Line2" & Chr(10) _
             & "Line3"
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Adding multiple rows of text in a Msgbox.!

    Thanks a lot Dominic once again for the help...
    Now i will try to mark the thread as SOLVED. and its not happening...

    No dropdown's appearing even though the post is absolutely new...

  6. #6
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile Re: Adding multiple rows of text in a Msgbox.!

    Hi e4excel

    You need to do this on your first post - otherwise the dropdown isn't there.

    I've done it for you.

    DominicB

+ 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