34

I'm using LibreOffice Calc and my data sheet contains a couple of empty rows. For example:

enter image description here

I'd like to know how I can delete all empty rows from the selection. As a workaround I've tried to copy the selection, remove it, then "paste special", tick "Skip empty cells", however this did paste all the empty cells as well.

If there was a way to select all empty rows from a given selection then I could simply delete them. However I didn't find a way for that either.

a_guest
  • 599

3 Answers3

43

Not in one go, but with a small workaround:

  1. Select the whole of your spreadsheet (e.g. by clicking in the empty square to the left of the "A" column header).
  2. Turn on Autofilter. enter image description here
  3. From the drop down list at the top of a column, select "Empty" in each column until you end up with only empty rows.
  4. Select and delete these.
  5. Reset the filter.

Your non-empty lines will reappear.

lewis4u
  • 4,866
Jos
  • 29,224
  • 5
    Small addition for non-familiar with Autofilter (as me) https://help.libreoffice.org/Calc/Applying_AutoFilter Thank you, it works great. Standard filters with custom expressions helped me a lot. – reconsio Jun 11 '18 at 20:03
  • I used this the other way : in the autofilters list, i unchecked only 'empty' and copied the remaining cells in another – Benj Nov 06 '19 at 10:18
  • 2
    "Turn on Autofilter" is in menu Data > Autofilter, and "Reset the filter" is Data > More Filters > Reset Filter – M.M Aug 03 '20 at 09:48
5

Another workaround would be to sort the data by a column that you know will contain a value for every single row that contains data.

  1. Select column range
  2. Data > Sort...

All relevant rows should end up at the top.

stragu
  • 1,958
1

I know this question is quite old right now, but recently an extension has been released that makes it quite easy to remove empty rows and columns in a variety of ways.

It is on Github: https://github.com/rafaelhlima/remove_blank_cells

Rafael
  • 655
  • 2
  • 6
  • 12