Consulting

Results 1 to 5 of 5

Thread: msgbox help

  1. #1
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location

    msgbox help

    My thanks to fireftr on my last problem. It help me get the attention I needed from higher up, so thank you again. This is an easy one just cant seem to get it to work.

    How do you put multiple lines in a MsgBox? Also, how can you control the size back color and position?

    Thanks again to all that have helped in the past, present and future.

  2. #2
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    Hi Austen (again ),


    Not sure if you can control the msgbox features from within Excel. They are Windows properties. You can set it by going to your control panel -> Display -> Appearance, but that would change everything, not just a msgbox. Colo has designed something called ktMsgBox, which allows for manipulation of the msgbox environment. A download link is here, and it is an add-in.

    As far as putting multiple lines, you can use quite a few things ...

    Sub tesingForAusten()
        MsgBox "This is line one of the message box." & vbCrLf & _
            "This is line two here." & vbNewLine & vbNewLine & _
            "We skipped a line and went to four." & vbCrLf & vbCrLf & _
            vbCrLf & vbCrLf & "Thank you, Management.", vbInformation, "Hello"
    End Sub
    The vbNewLine is pretty self explanatory, but the vbCrLf stands for Carrige Return/Line Feed. You could use them seperately, but it's generally good practice to use them in conjunction.


    Hope this helps Austen.

  3. #3
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    To control the position, coloring etc. of a message box you should start using User Forms. You can make a User Form that looks just like a message box and it will give you a lot more flexibility.

  4. #4
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    Thanks both of you. Will try them out.

  5. #5
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    You're Weclome

    Take Care

Posting Permissions

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