Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have a userform with a bunch of textboxes, checkboxes, etc. I want to allow the user to navigate through the controls using tab/shift-tab OR Enter/arrow keys. Specifically, I would like Enter, right arrow, or down arrow to equal a tab, and left arrow or up arrow to equal a shift-tab. Here is my code: Private Sub cmdButton_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer) If KeyCode = 13 Or KeyCode = 39 Or KeyCode = 40 Then KeyCode = 9 If KeyCode = 37 Or KeyCode = 38 Then Shift=1 and KeyCode=9 'SendKeys "+{TAB}" End If End Sub The first If statement works fine, but the second does not. I imagine the problem relates to the fact that Shift is not a return integer, like KeyCode, but the SendKeys statement that is commented out didn't work either. How can I return a shift-tab using KeyCode, or is there a better way to accomplish my goal? Thanks! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
keydown event | Excel Programming | |||
keydown event | Excel Programming | |||
user form-on open event? keydown event? | Excel Programming | |||
keydown event | Excel Programming |