I am running 32-bit Excel 2010. I have created multiple ActiveX Control combo boxes and they all have numbers of entries in their drop-down lists. The thing is that instead of using mouse click to scroll the list, I want to use the mouse scroll to scroll the list, but it actually doesn't work. When I scroll inside of the list, it scrolls the whole list down instead of the content in it. So does anyone know how to add this feature to it?
2
votes
stackoverflow.com/questions/15992475/… may help
– sancho.s ReinstateMonicaCellio
and mrexcel.com/forum/excel-questions/…
– sancho.s ReinstateMonicaCellio
Were you able to get this to work? I tried using the below code and it doesn't work, it stops the page from scrolling but still doesn't allow the combobox to scroll. If you were able to get it to work, can you post the code please?
– Chris
1 Answers
2
votes
I used this method to stop the list detaching from the combo box and moving down the sheet with the mouse scroll. It actually disables the mouse scroll, but you can still move the mouse to select an item, and operaton the right scroll bar if it appears.
- Select the row(s) where you have placed the ActiveX combo Box and the sheet
- Type a named range in the Formula Bar, and press enter. eg: "rngJobRoleCombo"
- Right click on the control in Development mode, and select "View Code"
Select the control's GotFocus event
Private Sub cboJobRole_GotFocus() Me.ScrollArea = Range("rngJobRoleCombos").Address End Sub
Select the controls LostFocus event
Private Sub cboJobRole_LostFocus() Me.ScrollArea = "" End Sub
This limits the mouse scroll to the cell range address of the worksheet while the control is in focus.