This site will look better if you upgrade to a browser that supports web standards.
In XL2001 and XL v.X, the Return and Enter keys are mapped to the same behavior. If you check the Move selection on Return checkbox in and set the direction dropdown to "down", both the Return key and the Enter key cause the selection to move down. I prefer to have the Return key move the selection down and the Enter key to cause the selection to remain in the active cell.
To do this, I call the following macro from my Workbook_Open() event code in the Personal Macro Workbook:
Public Sub SetUpEnterKey() Application.OnKey "{ENTER}", "" End Sub
This macro changes the default behavior of the Enter key and causes nothing to happen when it is pressed. Edit mode is unaffected, so Enter still terminates edit mode, but selection movement is removed.
From time to time, I've also used OnKey and a macro to direct the Enter key to perform some other function. Putting the macro name within the last set of double quotes will cause the macro to be executed whenever Enter is typed.
The Return key retains the settings in , though you could similarly use OnKey to have Return execute a macro.
This page last updated
© Copyright 2001 - 2004 McGimpsey and Associates. Except where noted, all code on this site may be distributed under the Gnu GPL. Acknowledgement is appreciated.