Forum Discussion
Anggie
Sep 04, 2019Copper Contributor
VBA Drop Down List
Hi Everyone, I developed a combo box drop down list and added a code that works fine but doesn’t let me scroll down my listed options using my down arrow keyboard button. Is there a code to use the d...
JKPieterse
Sep 05, 2019Silver Contributor
I expect changing the listfillrange causes the listindex to be reset, hence you cannot go through the items iwith the keyboard as the list keeps changing?
- AnggieSep 05, 2019Copper ContributorI’m not changing the list range. The issue is when I click on the combo box and try to scroll down it crashes.
- Subodh_Tiwari_sktneerSep 06, 2019Silver Contributor
You can set the ListFillRange utilizing an event called GotFocus so that it doesn't set the ListFillRange each time you type in the ComboBox.
Private Sub ComboBox1_GotFocus() ComboBox1.ListFillRange = "DropDownListv1" End Sub
- AnggieSep 06, 2019Copper ContributorThis works but it only allows me to select the first name on my list and not let me keep scrolling down the other options using the down key. Unless I use my clicker to select the other names.
What do you suggest can be added?
- JKPieterseSep 05, 2019Silver ContributorWell, yes, the code that runs as you change the combo updates the listfillrange
- AnggieSep 05, 2019Copper ContributorOk I understand what you mean. Yes the purpose of my combo box is for me to type in the first two letters of a name and it gives me options to choose the right one. Like doing a google search in excel for names.
What would be an alternate code?