Microsoft KB Archive/124213

= How to Enter a Second Line in a Message Box =

Article ID: 124213

Article Last Modified on 10/11/2006

-

APPLIES TO


 * Microsoft Excel 97 Standard Edition
 * Microsoft Excel 95 Standard Edition
 * Microsoft Excel 5.0 Standard Edition

-



This article was previously published under Q124213





SUMMARY
In a Microsoft Visual Basic for Applications macro (Sub procedure), to display more than one line of text in a message box, use the line feed character (character code 13) as in the following sample code.



MORE INFORMATION
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.

Sample Visual Basic Procedure
  Type the following macro into a new module sheet: Sub Test MsgBox prompt:="Line1" & Chr(13) & "Line2" End Sub  Run the "Test" macro.

A message box appears with the following text:

Line1

Line2

