0

I have a project in google sheets, and every 5 minutes I would like a function to run that scrolls down to the last row that contains text. I have a function that works fine, however, I can't get the setInterval to work; I keep getting the reference error "setInterval is not defined."

function autoScroll() {
var s = SpreadsheetApp.getActiveSheet(),
    v = s.getRange('A:A').getValues(),
    l = v.length,
    r = 1;
while (l > 0) {
    if (v[l] && v[l][0].toString().length > 0) {
        r = (l + 2);
        break;
    } else {
        l--;
    }
}
SpreadsheetApp.setActiveRange(s.getRange(r, 1));

}

setInterval (autoScroll, 300,000);
Gregg
  • 1
  • 1

0 Answers0