I don't think you can do that, you would have to loop through starting from say 1000 and go backwards until you hit the first non-blank cell and that would be your last row or column.
You can write a macro to do this in excel which may help but I don't know if you can execute it with PHPExcel.