Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm trying to use the keydown event to make the down arrow key change
the selected item in a listbox. The focus is in a texbox, and I've put my code into the textbox_keydown event. The listbox selection is changed, but then the focus is moved from the textbox to the next control on the form. I don't want this... I want it to stay in the textbox. How can I do this? My event code is: Private Sub NameBox_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer) If KeyCode = vbKeyDown Then Application.EnableEvents = False With NamesListBox If .ListIndex < .ListCount - 1 Then .ListIndex = .ListIndex + 1 End If End With Application.EnableEvents = True Exit Sub End If End Sub Thanks for any help. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
problem moving frm cell2cell with keyboard arrow keys | Excel Discussion (Misc queries) | |||
scroll with arrow keys problem | Excel Worksheet Functions | |||
Arrow Keys | Excel Discussion (Misc queries) | |||
Keydown and SelStart problem | Excel Programming | |||
arrow keys | Excel Discussion (Misc queries) |