PDA

View Full Version : [SOLVED] msgbox help



austenr
11-04-2004, 03:26 PM
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.

Zack Barresse
11-04-2004, 03:46 PM
Hi Austen (again :hi: ),


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 (http://puremis.net/excel/cgi-bin/click.cgi?cnt=ktmsg&url=http://puremis.net/excel/soft/ktMsgBoxV313E.zip), 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. :yes

Jacob Hilderbrand
11-04-2004, 06:20 PM
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.

austenr
11-04-2004, 06:24 PM
Thanks both of you. Will try them out.

Jacob Hilderbrand
11-04-2004, 06:26 PM
You're Weclome

Take Care