Cursor use in Excel

D

Donna

Hi - How can I set the cursor to go U/D/R/L (that one for one PC). And then
on the other PC the cursor moves but in opposite directions.
 
G

Gord Dibben

You have covered all the directions.

What is opposite?

Also what action is moving the cursor?


Gord Dibben MS Excel MVP
 
R

Rick Rothstein

Are you asking how to reverse the meaning of the arrow keys on the keyboard
(that is, how to make the Up Arrow send the cursor down to the cell below,
and so on)? If so, I don't think you can do that... well, at least not
easily if at all. Perhaps there is some Windows API function calls that
might be able to be employed, but I wouldn't want to check until I knew if
that was your question or not.
 
S

Shane Devenshire

Hi Rick,

It's possibe to reassign all the keys on the keyboard, although I didn't
think that's what the user had in mind.

Here is the code:

Sub SetupRoutine()
Application.OnKey "{Down}", "myUp"
Application.OnKey "{Up}", "myDown"
Application.OnKey "{Right}", "myLeft"
Application.OnKey "{Left}", "myRight"
End Sub

Sub myUp()
ActiveCell.Offset(-1, 0).Select
End Sub

Sub myDown()
ActiveCell.Offset(1, 0).Select
End Sub

Sub myLeft()
ActiveCell.Offset(0, -1).Select
End Sub

Sub myRight()
ActiveCell.Offset(0, 1).Select
End Sub

Sub Reset()
Application.OnKey "{Down}"
Application.OnKey "{Up}"
Application.OnKey "{Right}"
Application.OnKey "{Left}"
End Sub

I've included a Reset routine because one might change one's mind. The
first route must be run first. To get it to run when you open a file attach
the code the thisWorkook's Open_Workbook event.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top