We will be migrating from Ask to Discourse on the first week of August, read the details here

Ask Your Question

Calc - Deleting multiple rows - Selection windows goes back to single [closed]

asked 2016-08-27 18:07:07 +0200

miketurn gravatar image

updated 2020-09-11 08:24:25 +0200

Alex Kemp gravatar image

Hello Everyone,

In Calc if you window select say 5 rows and then you use the "Insert Rows Above" tool it will add another 5 rows, keeping the selection window at 5 rows so you can repeat this function if desired.

If you try the same thing with the "Delete Rows" tool it will delete 5 rows but then the selected window of 5 rows gets delete leaving behind just one cell selected, preventing you from repeating this process again.

Probably not really a bug, I would imagine this is programmed to function this way on purpose, which does make sense, but is there any way of making this react the way I describe above?

Thank You

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2020-09-11 08:25:16.875189

1 Answer

Sort by » oldest newest most voted

answered 2016-08-27 18:30:53 +0200

mark_t gravatar image

updated 2016-08-27 21:02:59 +0200

You could write a macro and assign to a hotkey to perform this function.

OpenOffice Macros Explained

Edit to add example macro.

Note. original range is selected, as seen by the colour of the column and row titles, but the selected range is no longer shaded. Maybe I'm missing something here.

REM  *****  BASIC  *****

Option Explicit

Sub DeleteRange
'   Delete Range and keep the current selection range

    Dim oCurSelection As Object
    Dim oController As Object
    Dim sAbsoluteName As String

    oCurSelection = thisComponent.CurrentSelection
    sAbsoluteName = oCurSelection.AbsoluteName

    oCurSelection.Spreadsheet.removeRange(oCurSelection.RangeAddress, com.sun.star.sheet.CellDeleteMode.UP)

    oController = ThisComponent.getCurrentController()

End Sub
edit flag offensive delete link more

Question Tools

1 follower


Asked: 2016-08-27 18:07:07 +0200

Seen: 723 times

Last updated: Aug 27 '16