Is there a way to in Google Spreadsheets to remove / delete empty rows?
Ideally I'd like to be able to select the columns to check.. ie. Select columns D, E and remove all the empty rows from them or being able to select A1:E50 and delete all empty rows in that range, instead of doing it sheet wide.
Best Answer
I've built two solutions, the difference is whether it removes all empty cells in the selected range or only the ones where all cells in a row (in the selection) is empty.
Both solutions require an additional sheet "ScriptSheet", which you can hide.
Both solutions shift the remaining cells up, including the ones below the selections.
You can try both here, they can be found in a custom menu called "Scripts". Make a copy of the spreadsheet.
Solution 1
This script only removes cells if an entire row of cells in the selection is empty.
This function is much slower than the other one. It went through about 1000 lines in the first of three columns before canceled by the six minute limitation.
Solution 2
This solution removes all empty cells in the selection.
There is two functions in this one, one two find the first empty cell in a column. This function (as perhaps the rest as well) is probably possible to write more efficient.
This solution is obviously faster the the previous one. It went through 1555 rows, 3 columns, in 02 minutes and 40 seconds.
I hope they can help!