I'm not sure if there's a way to "move" rows using the keyboard, but using c&p and inserting/deleting rows using the keyboard should offer the same functionality:
- navigate to the first (leftmost) cell of the row to move;
- hit SHIFT+SPACE to select the entire row;
- hit CTRL+C to copy the row;
- hit CTRL+- to delete the current row;
- navigate to the target row;
- hit ALT+I to open the
Insert
menu;
- hit R to insert a new row (the current row will get shifted downwards);
- hit CTRL+V to paste the row to its new place.
Since cut&paste operations are sometimes quite annoying, you may create a simple macro for cutting cells and another one to paste them, moving existing content down.
Here's a very simple code to "move" selected cells:
Option Explicit
Sub CopyAndCut
' ---------------------------------------------------------
' define variables
Dim document as object
Dim dispatcher as Object
Dim oSelections As Object
' ---------------------------------------------------------
' get access to the document and selections (if any)
document = ThisComponent.CurrentController.Frame
oSelections = ThisComponent.getCurrentSelection()
If IsNull(oSelections) Then Exit Sub
' ---------------------------------------------------------
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array())
dispatcher.executeDispatch(document, ".uno:Cut", "", 0, Array())
' -------------------------------------------------------------
' Check the width of the selection - if 1024 columns, we assume
' the complete row was selected and should get deleted
If 1024 = oSelections.Columns.getCount() Then
dispatcher.executeDispatch(document, ".uno:DeleteRows", "", 0, Array())
End If
End Sub
Sub InsertWithMoveDown
' ---------------------------------------------------------
' define variables
Dim document as object
Dim dispatcher as object
' ---------------------------------------------------------
' get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
' ---------------------------------------------------------
' Paste contents with "Move Down" option
Dim args1(5) as New com.sun.star.beans.PropertyValue
args1(0).Name = "Flags"
args1(0).Value = "A"
args1(1).Name = "FormulaCommand"
args1(1).Value = 0
args1(2).Name = "SkipEmptyCells"
args1(2).Value = false
args1(3).Name = "Transpose"
args1(3).Value = false
args1(4).Name = "AsLink"
args1(4).Value = false
args1(5).Name = "MoveMode"
args1(5).Value = 0
dispatcher.executeDispatch(document, ".uno:InsertContents", "", 0, args1())
End Sub
Sub InsertWithMoveRight
' ---------------------------------------------------------
' define variables
Dim document as object
Dim dispatcher as object
' ---------------------------------------------------------
' get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
' ---------------------------------------------------------
' Paste contents with "Move Right" option
Dim args1(5) as New com.sun.star.beans.PropertyValue
args1(0).Name = "Flags"
args1(0).Value = "A"
args1(1).Name = "FormulaCommand"
args1(1).Value = 0
args1(2).Name = "SkipEmptyCells"
args1(2).Value = false
args1(3).Name = "Transpose"
args1(3).Value = false
args1(4).Name = "AsLink"
args1(4).Value = false
args1(5).Name = "MoveMode"
args1(5).Value = 1
dispatcher.executeDispatch(document, ".uno:InsertContents", "", 0, args1())
End Sub
After copying the code to your user library, just assign CopyAndCut
to, e.g., Alt+C, InsertWithMoveDown
to, e.g., Alt+V, and InsertWithMoveRight
to, e.g., Alt+R (all these shortcuts are empty by default).
Now, you can select cells or rows using mouse or keyboard, cut them using Alt+C, move to the target cell, and paste them using Alt+V or Alt+R.
3
Moving rows in LibreCalc is super cumbersome. I've raised a bug 3 years ago to implement Excel's simple "Insert cut rows" context menu option, and was told that's a duplicate of a bug raised in 2011: insert copied cells. As of June 2016, this still hasn't been fixed.
– Dan Dascalescu – 2016-06-14T19:35:20.670Works easily here in 2019... Read comments below to see... – MattSlay – 2019-09-08T10:48:00.647