ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   KeyAscii won't capture the <Tab key (https://www.excelbanter.com/excel-programming/374065-re-keyascii-wont-capture-tab-key.html)

Bob Phillips

KeyAscii won't capture the <Tab key
 
If this is a userform, why not just trap the exit event?

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Bill Case" wrote in message
...
Hi;

In my procedure below, I need to capture the <LineFeed <Space <Tab or
<Click. I have managed to redirect everything but the <Tab. I have

tried
various values including 9, "9", Chr(9) and vbTab. Nothing works.

What can I do to make <Tab execute the right procedures rather than jump

to
the first enabled control? Something in Excel is overriding VBA.

Private Sub EnterButt0_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)


If KeyAscii = 9 Then
InsertBlankRow
CntrlsOpen
DayJoinedTxt0.SetFocus
End If

End Sub

Regards Bill





All times are GMT +1. The time now is 04:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com