Up/Down Arrow keys no longer work in ComboBox drop-down list with VBA code - can anyone help?

Copper Contributor

Am hoping someone can shed some light on what is a small, but annoying problem.  I have a searchable combo box with VBA code (not written by myself but culled from various internet sources, mainly stackexchange) in my spreadsheet to enable the user to type part of a word then pick from a list.  It used to be possible to move through the list with the up/down arrow keys, but recently this functionality seems to have stopped working and pressing the down key just selects the first item in the list.  I'm wondering if it's a setting in Excel or my ComboBox that I've missed, a problem with my code or something else entirely...?

 

I have attached an example file with the VBA code - and copied the relevant section below.

I have searched this forum and many others in the hope of finding the answer, many people seem to have the same problem, but no-one seems to have a solution.

If anyone can help, I'd be most grateful, it's driving me round the bend!

Thanks in advance, Alison.

 

Private Sub ComboBox_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
 ' To enable arrow keys in a combo box
   Select Case KeyCode
      Case 34 'vbKeyPageDown
      If ComboBox.ListIndex <> ComboBox.ListCount - 1 Then
        ComboBox.ListIndex = ComboBox.ListIndex + 1
      Else
        ComboBox.ListIndex = 0
      End If
         Case 33 'vbKeyPageUp
      If ComboBox.ListIndex <> 0 Then
         ComboBox.ListIndex = ComboBox.ListIndex - 1
      Else
        ComboBox.ListIndex = ComboBox.ListCount + 1
      End If
'Code to save entry and move along to next cell when if Tab or Enter are pressed - THIS BIT WORKS
    Case 9 'Tab
      ActiveCell.Value = Me.ComboBox.Value
      ActiveCell.Offset(0, 1).Activate
    Case 13 'Enter
      ActiveCell.Value = Me.ComboBox.Value
      ActiveCell.Offset(0, 1).Activate
    Case Else
        'do nothing
   End Select
End Sub
1 Reply

@AlisonR I have the same problem. Does anyone have a solution?