Skip to content

Instantly share code, notes, and snippets.

@oonisidesu
Created August 4, 2018 13:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oonisidesu/09592d826580898766e34d1c5f55e199 to your computer and use it in GitHub Desktop.
Save oonisidesu/09592d826580898766e34d1c5f55e199 to your computer and use it in GitHub Desktop.
function myFunction() {
var sheet = SpreadsheetApp.getActiveSheet();
var lastRow = sheet.getLastRow();
for(var i = 2; i <= lastRow; i++) {
if(!sheet.getRange(i, 2).getValue()){
Logger.log(sheet.getRange(i, 1).getValue());
sheet.getRange(i, 2).setValue(true);
break;
}
}
if(i >= lastRow) {
Logger.log(sheet.getRange(2, 2, lastRow - 1).getA1Notation());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment