【发布时间】:2018-08-16 04:06:19
【问题描述】:
目前我正在开发一个用户表单,只要单击组合框下拉按钮,就会提示输入框输入范围。
The problem is that whenever the range is selected (selecting a cell and then clicking ok), the userform is unselected (greys out), shows an empty dropdown list and forces me to reselect a range after I click anywhere on the workbook .
有什么方法可以防止点击下拉按钮时重新选择范围?
代码如下:
Private Sub ComboBox1_DropButtonClick()
Dim InputCell As Range
Set InputCell = Application.InputBox("Select Lookup Cell", "Obtain Object Range", Type:=8)
ComboBox1.Text = InputCell.Address(0, 0, external:=True)
End Sub
【问题讨论】:
-
谁能帮我格式化这个问题?我不知道为什么,但我无法添加图片。它告诉我缩进我的代码...@PeterT 非常感谢。
-
RefEdit 对象有问题!
-
似乎
DropButtonClick事件被触发了两次,一次是在进入的时候,一次是在离开的时候......因此出现了问题。 -
即使移除通常会导致问题的框架也无济于事