display a 2 row message pop -up vba 6

Radu Puspana picture Radu Puspana · Feb 15, 2011 · Viewed 23.2k times · Source

is there a way to display a 2 or 3 or 4 or n line message on a pop-up window in vba 6 ?

For the moment my pop-up window ( calling the MsgBox function) displays the message like this :

       You did something wrong. Please enter valid input.

and I want it to display the message like this

      You did something wrong. 
     Please enter valid input.

can you please provide a code sample?

many thx in advance, radu

Answer

Hans Olsson picture Hans Olsson · Feb 15, 2011

Just add a newline in your message:

MsgBox "Text 1" & vbNewLine & "text 2.