excel - 返回 VBA InputBox 的数量?
问题描述
因此,目前在特定条件下,我会弹出此 InputBox 供用户输入注释,然后该框将这些注释填充到单元格中。我想做的是,如果注释已经在 InputBox 正在填充注释的单元格中,这些注释将已经出现在输入字段中,以便用户可以添加到它们。我不知道这是否可以做到,并且在谷歌上找不到任何东西。如果不能这样做,请使用 insted 用户表单。
当前调出输入框的代码如下,“notes”是 InputBox 填充到的字段:
If InStr(OPs, "Incomplete") > 0 Or InStr(OPs, "Miss") Then
notes.Interior.Color = RGB(255, 200, 0)
If notes = "" Then
Do While notes = ""
notes = notes & InputBox("You must imput notes for " & Desc & " !", "Notes")
Loop
End If
End If
解决方案
使用 的Default
参数InputBox
:
就像是:
notes = notes & InputBox("You must input notes for " & Desc & " !", "Notes", notes)
但是,如果你使用它,你不想使用,notes = notes & ...
因为字符串字段会很快溢出......所以也许只是:
notes = InputBox("You must input notes for " & Desc & " !", "Notes", notes)
推荐阅读
- azure - 在生产环境中运行 Azure API 管理开发人员层
- javascript - 使用包含索引的字符串设置对象的嵌套值
- javascript - 文档上的 mouseenter 和 mouseleave 事件侦听器在 Firefox 中不起作用
- python - BeautifulSoup find_all(text=True) 没有打印任何东西?
- f# - F# 有对象引用还是复制对象
- c - 关于c编程中的break语句和循环的终止
- python - 使用字节解密消息
- r - 根据 R 中多次出现的分隔符将数据框列拆分为多列
- cucumberjs - 将 cucumberjs 从版本 6 迁移到 7 时出错
- python - 在 Python 断言消息中引用参数的传统方式是什么?