1. Select the range containing blank rows you want to remove.
2. Click Home > Find & Select > Go To Special.

3. In the Go To Special dialog box, check the Blanks option.

4. And then click OK, all of the entire blank rows are highlighted. Then click Home > Delete > Delete Cells,then select shift cells up then the blank cells have been deleted from the selected range.

To delete rows, repeat steps 1 to 3 then, all of the entire blank rows are highlighted. Then click Home > Delete > Delete Sheet Rows, the blank rows have been deleted from the selected range.
See screenshots:
2. Click Home > Find & Select > Go To Special.
3. In the Go To Special dialog box, check the Blanks option.
4. And then click OK, all of the entire blank rows are highlighted. Then click Home > Delete > Delete Cells,then select shift cells up then the blank cells have been deleted from the selected range.
To delete rows, repeat steps 1 to 3 then, all of the entire blank rows are highlighted. Then click Home > Delete > Delete Sheet Rows, the blank rows have been deleted from the selected range.
See screenshots: