单击userform打开文本框VBA Excel

时间:2022-02-09 09:10:40

I am not very good with userforms so hopefully this is an easy question.

我对用户表单不太满意,所以希望这是一个简单的问题。

I have a userform in a spreadsheet that opens with

我在打开的电子表格中有一个用户表单

UserForm1.Show False

To ensure excel can still be used while it is open. What I would like to happen is that whenever you click away from (but not close) the userform a text box is opened asking if you want to maintain the edited values or not. I can't figure out how to initiate more code when the userform is no long the point of interest. Usually items on userforms have enter and exit which I believe would do what I need but I can't find the equivalent for the actual userform.

确保excel在打开时仍可使用。我想要发生的是,每当您点击(但不关闭)userform时,都会打开一个文本框,询问您是否要保留编辑的值。当用户形态不再是兴趣点时,我无法弄清楚如何启动更多代码。通常用户表单上的项目都有进入和退出,我相信它会做我需要的但我无法找到实际用户表单的等效项。

Any advice would be appreciated.

任何意见,将不胜感激。

1 个解决方案

#1


0  

To allow a user to enter values into excel while a form is visible, you will need to update the ShowModal property on the userform to false.

要允许用户在表单可见时将值输入到Excel中,您需要将userform上的ShowModal属性更新为false。

单击userform打开文本框VBA Excel

Or as you are showing the userform, you can show it vbModeless.

或者当您显示userform时,您可以将其显示为vbModeless。

UserForm.Show vbModeless

#1


0  

To allow a user to enter values into excel while a form is visible, you will need to update the ShowModal property on the userform to false.

要允许用户在表单可见时将值输入到Excel中,您需要将userform上的ShowModal属性更新为false。

单击userform打开文本框VBA Excel

Or as you are showing the userform, you can show it vbModeless.

或者当您显示userform时,您可以将其显示为vbModeless。

UserForm.Show vbModeless