Home > Macros > Move Selection

Move Selection

February 4th, 2009 Leave a comment Go to comments

These macros change the default direction after pressing enter, of down, to whichever direction you specify. Particularly useful if entering data across several columns rather than down a single row. It keeps you from having to click through all the Excel menus to find where this option is located in Excel. Direction variables are as follows: Up: xlUp; Down: xlDown; Left: xlToLeft; Right: xlToRight.

Copy all of the code below. Paste it into your workbook’s Visual Basic editor, either under a Microsoft Excel Object or Module.

Need help? Use our nifty guide to help figure out how to install and use your macros.

Move Up:

Sub move_selection_up()
'MACROS BY EXCELZOOM.COM
'Moves selection up on enter
'
Application.MoveAfterReturnDirection = xlUp
End Sub

Move Down:

Sub move_selection_down()
'MACROS BY EXCELZOOM.COM
'Moves selection down on enter
'
Application.MoveAfterReturnDirection = xlDown
End Sub

Move Left:

Sub move_selection_left()
'MACROS BY EXCELZOOM.COM
'Moves selection left on enter
'
Application.MoveAfterReturnDirection = xlToLeft
End Sub

Move Right:

Sub move_selection_right()
'MACROS BY EXCELZOOM.COM
'Moves selection right on enter
'
Application.MoveAfterReturnDirection = xlToRight
End Sub

Categories: Macros Tags:
  1. No comments yet.
  1. No trackbacks yet.