Solved Move several full rows up and down with shortcut (solved)

Microsoft Excel 2010
January 22, 2013 at 02:21:05
Specs: Windows 7

I had read an old question regarding how to move in Excel full rows up and down in a simple way from an old post here. That has been very helpful and also what I was looking for...

I have refined the macro a little bit, hope it is useful to you or somebody else.

With these small changes you can actually move *several* rows in one go, up or down - just select them beforehand.

Also, I've added a shortcut, alt-shift-up and alt-shift-down to both moves.

How to use:
* Create new workbook
* Add this code in a module
* Save the workbook as an add-in (.xla or .xlam); it should point you to the correct template folder when you select the file type .xla or .xlam
* Add your saved add-in to your list of active add-ins

Once this is done, alt-shift-up and alt-shift-down will move one, or multiple full rows, up and down automagically from where you are. And you can continue pressing the shortcuts to continue the effect.

Hope that helps!


Sub Auto_Open()
    Application.OnKey "+%{DOWN}", "RowDown"
    Application.OnKey "+%{UP}", "RowUp"
End Sub

Sub RowDown()
  Selection.Offset(1 + Selection.Rows.Count, 0).EntireRow.Insert Shift:=xlDown
  Selection.Offset(1, 0).Select
End Sub

Sub RowUp()
    If Selection.Rows(1).Row = 1 Then Exit Sub
    Selection.Offset(-1, 0).EntireRow.Insert Shift:=xlDown
    Selection.Offset(-1, 0).Select
End Sub

See More: Move several full rows up and down with shortcut (solved)

Report •

January 22, 2013 at 03:04:51
Doesn't shift and drag from the edge do the same thing?

Report •

January 22, 2013 at 03:53:33
Basically yes, as does shift-space, option-button, cut, and then select row, option-button, insert cut cells,

Thing is I've grown to rely less and less on the mouse and more and more on the keyboard, specially for this that I use quite often.

So this provides a quick shortcut for those of us that prefer easy keyboard, plus, in Word and PowerPoint the shift-alt-up/down combo does exactly that, while that shortcut is unused in Excel (for unknown reasons...)

Just hoping it would help someone!

Report •

January 22, 2013 at 11:56:30
✔ Best Answer
Fair enough although for those not familiar with excel we should point out the alternatives.

Report •

Related Solutions

Ask Question