vba 当用户从下拉 ComboBox (ActiveX) 中选择值时会触发什么事件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29362456/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 09:30:30  来源:igfitidea点击:

What event is triggered when user selects value from drop down ComboBox (ActiveX)?

vbaexcel-vbaactivexobjectexcel

提问by Madhan

What event is triggered when user selects value from drop down ComboBox (Active X). How it can be defined in VBA. I would like to trigger macro when value is selected from drop down.

当用户从下拉组合框(Active X)中选择值时会触发什么事件。如何在 VBA 中定义它。当从下拉列表中选择值时,我想触发宏。

采纳答案by kolcinx

ComboBox_Click()is the event you are looking for.

ComboBox_Click()是您要查找的事件。

回答by L42

If you're using a ComboBoxcontrol in a UserForm, it usually have an AfterUpdate Event.
If you're using an ActiveX Control ComboBoxin a Sheet, you can try LostFocus Event.

如果您在 中使用ComboBox控件UserForm,它通常有一个AfterUpdate Event.
如果您ActiveX Control ComboBox在工作表中使用 ,则可以尝试LostFocus Event.

Private Sub ComboBox1_LostFocus()

End Sub

This way, you can type in values and then run the routine after you select another object.

这样,您可以输入值,然后在选择另一个对象后运行例程。