Hier is een sub die ook werkt voor kolommen; het combineert de functionaliteit voor alle vier de richtingen:
Sub MoveRowsOrColumns(direction As String)
Dim rOriginalSelection As Range
Select Case direction
Case "up", "down"
Set rOriginalSelection = Selection.EntireRow
Case "left", "right"
Set rOriginalSelection = Selection.EntireColumn
Case Else
Debug.Assert False
End Select
With rOriginalSelection
.Select
.Cut
Select Case direction
Case "up"
.Offset(-1, 0).Select
Case "down"
.Offset(rOriginalSelection.Rows.Count + 1, 0).Select
Case "left"
.Offset(0, -1).Select
Case "right"
.Offset(0, rOriginalSelection.Columns.Count + 1).Select
End Select
End With
Selection.Insert
rOriginalSelection.Select
End Sub