Thread: Cursor movement
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Andrew Bourke Andrew Bourke is offline
external usenet poster
 
Posts: 18
Default Cursor movement

Hi
I have almost found what I need by inserting:

Application.Onkey "{RIGHT}", "RightArrowKeyPressed"

The sub RightArrowKeyPressed stores a value in a temp cell to tell me
the right arrow key has been pressed.
Before I exit the main routine I check for this temp value - empty and
the cursor is moved down, non empty and the cursor moves right.

The only issue I have now is that it doesn't seem to work on the first
instance.





On 25/01/2009 5:38 PM, Anant Basant wrote:
Private Sub Worksheet_Change(ByVal Target As Range)
Target.Offset(, 1).Select
End Sub

Probably is what you want to do. When user changes Target and presses enter
or arrow or selects any other cell, this code would run and select the cell
to the right.