2011-02-15 108 views
1

有沒有辦法在vba 6的彈出窗口中顯示2或3或4或n行消息?顯示2行消息彈出窗口vba 6

對於此刻我的彈出窗口(調用MsgBox函數)顯示這樣的信息:

 You did something wrong. Please enter valid input. 

,我希望它顯示這樣

 You did something wrong. 
    Please enter valid input. 

的消息,你可以請提供代碼示例?

許多THX提前, 拉杜

回答

4

就在你的信息添加一個新行:

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

THX這麼多,它完美地工作! – 2011-02-15 15:04:05

+0

你可以請直接給我更多的vba vbConstants? – 2011-02-15 15:05:13

2

比較容易申請

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")