Nov 7, 2018

How to delete Rows in Excel Sheet using JAVA with Apache POI

If you use
sheet.removeRow(row);
it will still leave an empty row there.

If you want to delete the row, you can shift all the rows below it 1 line above:
sheet.shiftRows(i + 1, sheet.getLastRowNum(), -1);
i is the index of the row (start from 0).
If the last parameter number is positive the rows shift down.

See the API