Results 1 to 7 of 7

Thread: Help with putting 2 lines jof text in a MsgBox(resolved)

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2003
    Location
    Upstate NY
    Posts
    19

    Resolved Help with putting 2 lines jof text in a MsgBox(resolved)

    Hey,

    I know this seems very elementary, but I can't get it to work!
    Could someone help me with the technique of making the line of text in a messagebox (or InputBox) appear as two lines?

    E.G. Msgbox "You must have the ABC Workbook open before proceeding!"
    This would appear in the box as:
    You must have the ABC Workbook open before proceeding!

    I would like it to appear as:
    You must have the ABC Workbook
    open before proceeding!

    I know I need to use the carriage return, but I don't know how to implement it.

    Thank you for your help.
    Don
    Last edited by Toolman; Feb 11th, 2005 at 05:20 PM.
    Don

  2. #2
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: Help with putting 2 lines jof text in a MsgBox

    Here you go

    VB Code:
    1. MsgBox "You must have the ABC Workbook" & vbCrLf & "open before proceeding!"


    Has someone helped you? Then you can Rate their helpful post.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Oct 2003
    Location
    Upstate NY
    Posts
    19

    Re: Help with putting 2 lines jof text in a MsgBox

    Thank you so much for the quick reply. This was reaally bugging me.

    Thanks again.
    Don

  4. #4
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: Help with putting 2 lines jof text in a MsgBox

    You're welcome

    Now that we've helped you, you can help us by editing the first post and adding the green checkmark. That indicates that you have your answer. You should also be aware (if you're not already) that you have the ability to rate a post if someone has been particularly helpful or even particularly unhelpful.


    Has someone helped you? Then you can Rate their helpful post.

  5. #5
    New Member
    Join Date
    Feb 2005
    Posts
    3

    Re: Help with putting 2 lines jof text in a MsgBox(resolved)

    What about Chr(10) fuction. Will it do the purpose?
    I use Chr(10), but some times it works and sometimes it says not in the library error. how to use it??

  6. #6
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: Help with putting 2 lines jof text in a MsgBox(resolved)

    Chr(10) is a linefeed, Chr(13) is a carriage return. vbCrLf is both together. vbNewLine is another option.


    Has someone helped you? Then you can Rate their helpful post.

  7. #7
    Addicted Member GSIV's Avatar
    Join Date
    Jun 2002
    Location
    Texas, USA
    Posts
    213

    Re: Help with putting 2 lines jof text in a MsgBox(resolved)

    Straight out of the MSDN library:

    String expression displayed as the message in the dialog box. The maximum length of prompt is approximately 1024 characters, depending on the width of the characters used. If prompt consists of more than one line, you can separate the lines using a carriage return character (Chr(13)), a linefeed character (Chr(10)), or carriage return–linefeed character combination (Chr(13) & Chr(10)) between each line.

Posting Permissions

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



Click Here to Expand Forum to Full Width