嗯 ,刚写了一个获取最后非空行的方法您也可以参考下
- function getNonEmptyRowIndex(sheet){
- var rowCount = sheet.getRowCount(), colCount = sheet.getColumnCount();
- for(var i = rowCount - 1; i >= 0; i--){
- for(var j = 0; j < colCount; j++){
- var value = sheet.getValue(i, j);
- if(value !== null && value !==undefined && value !== ''){
- return i;
- }
- }
- }
- return -1;
- }
复制代码 |