Created
August 30, 2019 12:18
-
-
Save phillypb/385dc06b33987bc0180715ab7aac0da0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This Function is designed to clear the adjacent cell to the right of the one | |
that has just been edited - so long as it is within the column we specify | |
(so only edits in column 2 here). | |
*/ | |
function onEdit(e) { | |
// get edited cell from the event object | |
var cell = e.range; | |
// get edited cell column from the event object | |
var column = cell.getColumn(); | |
Logger.log('Column is: ' + column); | |
// get edited cell row from the event object | |
var row = cell.getRow(); | |
Logger.log('Row is: ' + row); | |
// get spreadsheet from the event object | |
var source = e.source; | |
if (column == 2) { | |
// clear adjacent cell value | |
var ss = source.getSheetByName('Clear cell'); | |
ss.getRange(row, column+1).clear(); | |
} | |
else {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment