If you want to tidy up your worksheets in Google Sheets, you can start by getting rid of any empty rows. This method also allows you to remove unnecessary rows all at once without losing your sort order.
If you have a sheet that looks similar to the one in this example, here’s what you need to do.
Select the entire sheet or dataset and go to Data > Create a filter
Click on the Filter icon at the top of any column, then click on Clear and select (Blanks).
Now you can only see the empty rows. Click on the first empty row from the top, press and hold the Shift key and select the last empty row.
Right click on any selected row and click Delete Rows (2 - 1000) or whatever the numbers for empty rows are in your sheet.
Finally, go back to the Data tab and click Turn off filter.
You have now removed all the empty rows from your Google Sheet without losing your sort order.