+ Reply to Thread
Results 1 to 3 of 3

msgbox Question

  1. #1
    Forum Contributor
    Join Date
    06-13-2004
    Posts
    120

    msgbox Question

    I am having a serious lapse of knowledge right now...

    How do I make a msgbox have multiple lines of text instead of one ongoing line.

    ex.
    msg = "Q1: ------------------------------" & _
    "Q2: ------------------------------"
    style = vbokonly
    title = Test"

    msgbox msg, style, title

    When I do this, I get Q1: ----------------- Q2:---------------- and I need them on 2 lines.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Dok112,

    Add a Carraige Return Line Feed to the end of of line to start a new one...

    msg = "Q1: ------------------------------" & vbCrLf & _
    "Q2: ------------------------------"
    style = vbokonly
    title = Test"


    This will give you 2 lines.

    Sincerely,
    Leith Ross

  3. #3
    JakeyC
    Guest

    Re: msgbox Question

    Use the concatenate operator '&' to include Chr(10) in your string of
    text.

    ie MsgBox ("Hello there" & Chr(10) & "How are you")
    should display:

    Hello there
    How are you

    Chr(10) works a little like someone having pressed Return mid-sentence.


+ 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