Re-Mapping of {ENTER} key?

jfarc

Active Member
Joined
Mar 30, 2007
Messages
316
Is there any way to re-map keyboard keys (for my example would be the {Enter} key), but only when a particular macro is run?

I'm automating a data entry screen where the user is used to hitting the {ENTER} key, but in their original program(not Excel) it responds as if you hit the {TAB} key.

In other words, normally when the {ENTER} key is pressed, the cursor moves to the next cell below. I would like it to move to the next cell to the right.

I don't want to re-map the keyboard permanently outside of Excel, again only when this particular routine is run.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Try

Code:
'Move right after Enter
Application.MoveAfterReturnDirection = xlToRight
'
'
'move down after Enter
Application.MoveAfterReturnDirection = xlDown
 
Upvote 0
VoG,

That's perfect! I can use a ChangeEvent to control when I want the cursor to go down vs. to the right.

Brilliant!
 
Upvote 0

Forum statistics

Threads
1,214,551
Messages
6,120,159
Members
448,948
Latest member
spamiki

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top