I want this onEdit script in Google Sheets to start with line 2, which skips my title bar, but I canβt get it to work with my existing code? Can someone out there help noob?
function onEdit(e) { var ss = e.source.getActiveSheet(); var rr = e.source.getActiveRange(); //comment 2 lines below if you want it working on all sheets, not just on 2nd one if(ss.getIndex()!= 1) if(ss.getIndex()!= 2) if(ss.getIndex()!= 3) return; /// var firstRow = rr.getRow(); var lastRow = rr.getLastRow(); //the last modified date will appear in the 43th column which is the Last Update Column for(var r=firstRow; r<=lastRow; r++) ss.getRange(r, 43).setValue(new Date()); }
Just check if the current line is inside the header and exit the trigger:
function onEdit(e) { var rr = e.range; var ss = e.range.getSheet(); var headerRows = 1; // # header rows to ignore if (rr.getRow() <= headerRows) return; ...
Source: https://habr.com/ru/post/979129/More articles:Change the y axis limits for each facet line in ggplot2 - rNginx configuration for Joomla and Codeigniter inside a subdirectory - joomlaWindow.onload vs script postpone - javascriptopenssl skips the first few lines of a script, then reads from stdin - bashhttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/979128/date-conversion-issue-ms-access-to-sql-server&usg=ALkJrhg2t2qQE1upahyORpf5PLbb7YU6zwGoogle SCRIPT spreadsheet Check if the edited cell has been edited in a specific range - google-spreadsheethow to find out the first state of readiness of the DOM - javascriptNSURLSession downloadTask does not free memory - objective-cSQLAlchemy merges with compound foreign keys (with -flask-sqlalchemy) - pythonangular ui-grid / ng-grid filterChanged firing too often - angularjsAll Articles