当前位置:首页>维修大全>综合>

inputbox对话框点击 确定 取消 vba怎么写(vba inputbox得到的区域怎么使用)

inputbox对话框点击 确定 取消 vba怎么写(vba inputbox得到的区域怎么使用)

更新时间:2025-11-07 06:19:39

inputbox对话框点击 确定 取消 vba怎么写

dim ans As Variant

ans = MsgBox(输入你要显示的内容, vbOKCancel + vbDefaultButton2)

If ans = vbOK Then

....... 点确认执行的代码

Else

....... 点取消执行的代码

End If

如果是inputbox的话本身就自带确定和取消的,例如:

dim aaa as string

aaa=inputbox(输入你要显示的语句)

这样就可以了

更多栏目