显示2行消息弹出vba 6

时间:2011-02-15 14:56:49

标签: string excel vba msgbox

有没有办法在vba 6的弹出窗口中显示2或3或4或n行消息?

目前我的弹出窗口(调用MsgBox函数)显示如下消息:

       You did something wrong. Please enter valid input.

我想让它显示这样的消息

      You did something wrong. 
     Please enter valid input.

你能提供代码样本吗?

事先很多次, 拉杜

2 个答案:

答案 0 :(得分:7)

只需在邮件中添加换行符:

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

答案 1 :(得分:3)

相对简单的请求

    iResult = MsgBox("This information is on the first line. " & vbCrLf & "This information is on the 2nd line. " &vbCrLf & _
        "Do you wish to continue?", vbYesNo + vbInformation, "Message Box")