+ Reply to Thread
Results 1 to 4 of 4

VBA msgbox function

  1. #1
    LesLdh
    Guest

    VBA msgbox function

    I want to have a msgbox prompt that has two lines of text, eg:

    MsgBox("This is the first line
    this is the second line")

    I understand that I have to use a carriage return character, but can't seem
    to get the syntax right. Can anybody help?

    Les.

  2. #2
    Nick Hodge
    Guest

    Re: VBA msgbox function

    Les

    Msgbox "This is the first line"&Chr(13)&"This is the second"

    --
    HTH
    Nick Hodge
    Microsoft MVP - Excel
    Southampton, England
    [email protected]HIS

    "LesLdh" <[email protected]> wrote in message
    news:[email protected]...
    >I want to have a msgbox prompt that has two lines of text, eg:
    >
    > MsgBox("This is the first line
    > this is the second line")
    >
    > I understand that I have to use a carriage return character, but can't
    > seem
    > to get the syntax right. Can anybody help?
    >
    > Les.




  3. #3
    Alan Perkins
    Guest

    Re: VBA msgbox function

    Try this:

    MsgBox("This is the first line" & vbCrLf & "this is the second line")

    HTH

    Alan P.

    "LesLdh" <[email protected]> wrote in message
    news:[email protected]...
    >I want to have a msgbox prompt that has two lines of text, eg:
    >
    > MsgBox("This is the first line
    > this is the second line")
    >
    > I understand that I have to use a carriage return character, but can't
    > seem
    > to get the syntax right. Can anybody help?
    >
    > Les.




  4. #4
    Vasant Nanavati
    Guest

    Re: VBA msgbox function

    MsgBox "First line" & vbNewLine & "Second line"

    --

    Vasant


    "LesLdh" <[email protected]> wrote in message
    news:[email protected]...
    > I want to have a msgbox prompt that has two lines of text, eg:
    >
    > MsgBox("This is the first line
    > this is the second line")
    >
    > I understand that I have to use a carriage return character, but can't

    seem
    > to get the syntax right. Can anybody help?
    >
    > Les.




+ 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