VBA-msgbox 信息提示

2024-10-13 04:02:25

1、MsgBox函数可用于在对话框中显示信息。一旦显示出来,消息丸泸尺鸢框将一直保持,直至用户单击某个按钮为止。根据用户单吁炷纪顼击的按钮,会返回不同的整数值。MsgBox函数的语法如下:MsgBox(prompt[,buttons][,title][, helpfile, context])无返回值:MsgBox "Do you wish to save the changes to'"&_ThisWorkbook.Name&"'",vbYesNoCancel+vbExclamation有返回值:Dim iResponse As IntegerIResponse=MsgBox("Do you wish to save the changes to'"&_ThisWorkbook.Name&"'",vbYesNoCancel+vbExclamation)

2、下面是msgbox的buttons参数,从各组数值中只能选择一个。

VBA-msgbox 信息提示
猜你喜欢