简体   繁体   中英

Drop-Down List Detached From ComboBox - Excel VBA

The drop down list of a ActiveX ComboBox detaches whenever I scroll down the page. How can I fix it so it won't move?

Here's the VBA code designated for the comboBox.

Private Sub ComboBox1_Change()

ComboBox1.ListFillRange = "DropDownList"
Me.ComboBox1.DropDown

End Sub

If you switch out your ComboBox to the one from the Forms toolbar, then it collapses the list as soon as you start scrolling. I think the "detaching" of the dropdown is the default behavior and I don't think you can influence that programmatically ( as in here, too ).

See this post on the different options for the comboboxes:

Run Macro When ComboBox is Clicked

Another option is to disable the mouse scroll, as in this post:

VBA Excel Combobox: drop-down list scrolling issue

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM