为什么此msgbox代码弹出错误?

时间:2019-03-28 11:25:02

标签: excel vba

我试图制作一个仅带有OK选项的msgbox,但需要具有说明和标题。

MsgBox ("this is where i put my message", vbOKOnly, "this should be the title")

当我尝试运行代码时,它只是给我一条错误消息

1 个答案:

答案 0 :(得分:1)

丢失括号

MsgBox "this is where i put my message", vbOKOnly, "this should be the title"

或者,你可以做

rspns = MsgBox ("this is where i put my message", vbOKOnly, "this should be the title")

尽管后者不会使您受益。如果您要使用消息框来捕获响应(例如vbYesNo),该消息框将是一种使用方法,则响应将存储在rspns变量中。

相关问题