ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Last KeyStroke (https://www.excelbanter.com/excel-programming/414469-last-keystroke.html)

Mike H.

Last KeyStroke
 
Is there a way VBA can tell the last keystroke that a user entered? Here is
what I want to do:
If the user hits enter, instead of going down one row, I wish to go across
one column. But if they press the arrow keys, then I don't want to "alter"
their choice.

So if they press the down arrow, they go down one cell, but if they press
the enter key they go right one cell. Ideas?

[email protected]

Last KeyStroke
 
On Jul 23, 11:03*am, Mike H. wrote:
Is there a way VBA can tell the last keystroke that a user entered? *Here is
what I want to do:
If the user hits enter, instead of going down one row, I wish to go across
one column. *But if they press the arrow keys, then I don't want to "alter"
their choice. *

So if they press the down arrow, they go down one cell, but if they press
the enter key they go right one cell. *Ideas?


Google "OnKey events"...

or check out this

http://msdn.microsoft.com/en-us/libr...ffice.11).aspx

Jim Thomlinson

Last KeyStroke
 
Tools - Options - Edit tab and change Move Selection After Enter to Right.
--
HTH...

Jim Thomlinson


"Mike H." wrote:

Is there a way VBA can tell the last keystroke that a user entered? Here is
what I want to do:
If the user hits enter, instead of going down one row, I wish to go across
one column. But if they press the arrow keys, then I don't want to "alter"
their choice.

So if they press the down arrow, they go down one cell, but if they press
the enter key they go right one cell. Ideas?



All times are GMT +1. The time now is 02:31 PM.

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