VBA: Line Break or Line Feed in a Message Box

August 14th, 2004 | Categories: VBA | Tags: , ,

If you need to put a larger amount of text in a message box, the use of line feeds can help create a more readable format.

To add a line feed to a msgbox in vba, add the word vbCrLf to your string as you would regular text, using the ampersand. You can also use multiple vbCrLf’s to create many line feeds. Here is an example:

MsgBox "line 1" & vbCrLf & "line 2"


Get LIVE Help
Custom Excel solutions & live Excel help!
► Go to www.ExcelAutomationHelp.com
► Email Now@ExcelAutomationHelp.com
  1. June 30th, 2010 at 11:45
    Reply | Quote | #1

    Hey I was just wandering around the web and found your site, definitely glad I did because it had some of the information I was looking for for a report for school, thanks a mil.