excel - 为什么这个 msgbox 代码会弹出错误?
问题描述
我正在尝试制作一个只有 OK 选项的 msgbox,但需要有描述和标题。
MsgBox ("this is where i put my message", vbOKOnly, "this should be the title")
当我尝试运行代码时,它只会给我一条错误消息
解决方案
去掉括号
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
变量中。
推荐阅读
- c# - 使用 windows 命令行从 C# 项目生成 DLL
- azure-cosmosdb - 带有 JOIN 的 Azure Cosmos DB (NOT IS_DEFINED OR) 子句始终计算为 false
- r - 基于R中字符位置数字的变量名称
- c++ - GetEnvironmentVariableW 和 GetEnvironmentStringsW 返回不同的值
- html - 如何使 2 列相互浮动
- arrays - 如何对导入的包含数字和文本字符串的 IMPORTHTML 列进行排序或过滤?
- vb.net - 无法使用 excel 16.0 找到可安装的 ISAM
- php - Laravel 中多个条件的多次急切加载
- python - 使用列表索引创建字典
- javascript - 如何以动态多重形式进行自动计算?