[vba] Add newline to VBA or Visual Basic 6

I want to concatenate two strings with a linebreak between them.

st = "Line 1" + newline + "Line2"

How do I add a newline to VBA or Visual Basic 6?

This question is related to vba vb6

The answer is


There are actually two ways of doing this:

  1. st = "Line 1" + vbCrLf + "Line 2"

  2. st = "Line 1" + vbNewLine + "Line 2"

These even work for message boxes (and all other places where strings are used).


Use this code between two words:

& vbCrLf &

Using this, the next word displays on the next line.