If you use the UNO method, then according to the example below. And if you use the API?
By the way, what does the Sel parameter mean in the “.uno:GoUp” method?
Sub UnoGoUp()
''' Go up 1 row skipping invisible rows.
''' Called by: DeleteCurrent
Dim document As Object, dispatcher As Object
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
Dim args(1) As New com.sun.star.beans.PropertyValue
args(0).Name = "By"
args(0).Value = 1
args(1).Name = "Sel"
args(1).Value = False
dispatcher.executeDispatch(document, ".uno:GoUp", "", 0, args())
End Sub
It is necessary if the last record has been deleted. Otherwise we will be out of range.