0

so basically I need to pause the macro code, wait for user input and then continue the rest of the code. I know that by using the "modeless userform", this can be done. But the point now is that all the code after the userform popped up needed to written in the command button part (basically it is the userform own module). And because of that, all the initialization, all the variables that I still need has been wiped off.

So I am asking is there a way to pause in the middle of a vba code then, wait for user input, then continue the rest of the code

Thank you very much for your help

4

1 回答 1

1

“用户输入”是什么意思?

  • 标准输入法MsgBoxInputBox模态用户表单可以满足您的要求;

“弹出用户表单后的代码需要”...

  • 与其关闭表单,不如隐藏它。代码继续,表单数据仍然可用;

现在,如果你的意思是“用户输入”,操作工作簿,你必须继续事件:

  • 示例:在用户输入之前创建一个宏,然后将剩余的代码放在一个Worksheet_Change事件中。
于 2013-08-01T08:32:44.963 回答