Google 시트의 단일 열에 마지막 값을 가져 오는 함수를 작성했습니다.특정 열의 마지막 값을 얻는 효율적인 방법
// Returns the row number of the first empty cell
// Offset should be equal to the first row that has data
function getLastRowInColumn(sheet, column, rowOffset) {
var lastRow = sheet.getMaxRows();
for (var row = rowOffset; row < lastRow; row++) {
var range = sheet.getRange(row, column);
if (range.isBlank()) {
return row;
};
}
}
I 모든 값은 따라서 기능을 실제로 발견 된 첫 번째 빈 셀 복귀되어 작성되는 것을 가정 할 수있다 (이 경우, 즉, 제 빈 행에 해당).
~ 1000 행의 시트를 실행하는 데 시간이 오래 걸립니다. 어떻게하면 더 효율적으로 만들 수 있습니까?
미리 감사드립니다.