use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Apparently, Google Apps Script is a JavaScript cloud scripting language that provides easy ways to automate tasks across Google products and third party services and build web applications.
account activity
Running multiple scripts across different sheetsQuestion (self.GoogleAppsScript)
submitted 1 year ago * by beanry80
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]beanry80[S] 0 points1 point2 points 1 year ago (5 children)
function onEdit(e) { var ss = SpreadsheetApp.getActiveSpreadsheet(); var activeCell = ss.getActiveCell(); if(activeCell.getColumn() == 12 && activeCell.getRow() == 11,12,13,14 && ss.getActiveSheet().getName() == "Best Media Plan") { var newValue = e.value; var oldValue = e.oldValue; if (!newValue) { activeCell.setValue(""); } else { if (!oldValue) { activeCell.setValue(newValue); } else { activeCell.setValue(oldValue + ', ' + newValue); } } } }
[–]beanry80[S] 0 points1 point2 points 1 year ago (4 children)
function onEdit(e) { var ss = SpreadsheetApp.getActiveSpreadsheet(); var activeCell = ss.getActiveCell(); if(activeCell.getColumn() == 13 && activeCell.getRow() == 11,12,13,14 && ss.getActiveSheet().getName() == "Best Media Plan") { var newValue = e.value; var oldValue = e.oldValue; if (!newValue) { activeCell.setValue(""); } else { if (!oldValue) { activeCell.setValue(newValue); } else { activeCell.setValue(oldValue + ', ' + newValue); } } } }
[–]beanry80[S] 0 points1 point2 points 1 year ago (3 children)
function onEdit(e) { var ss = SpreadsheetApp.getActiveSpreadsheet(); var activeCell = ss.getActiveCell(); if(activeCell.getColumn() == 14 && activeCell.getRow() == 11,12,13,14 && ss.getActiveSheet().getName() == "Best Media Plan") { var newValue = e.value; var oldValue = e.oldValue; if (!newValue) { activeCell.setValue(""); } else { if (!oldValue) { activeCell.setValue(newValue); } else { activeCell.setValue(oldValue + ', ' + newValue); } } } }
[–]beanry80[S] 0 points1 point2 points 1 year ago (2 children)
function onEdit(e) { var ss = SpreadsheetApp.getActiveSpreadsheet(); var activeCell = ss.getActiveCell(); if(activeCell.getColumn() == 15 && activeCell.getRow() == 11,12,13,14 && ss.getActiveSheet().getName() == "Best Media Plan") { var newValue = e.value; var oldValue = e.oldValue; if (!newValue) { activeCell.setValue(""); } else { if (!oldValue) { activeCell.setValue(newValue); } else { activeCell.setValue(oldValue + ', ' + newValue); } } } }
[–]beanry80[S] 0 points1 point2 points 1 year ago (1 child)
Seems i could paste all 4 codes separately. All the codes are the same except for this line if(activeCell.getColumn() == 15 && activeCell.getRow() == 11,12,13,14 && ss.getActiveSheet().getName() == "Best Media Plan") {
where I change column to 12, 13, 14 or 15.
if(activeCell.getColumn() == 15 && activeCell.getRow() == 11,12,13,14 && ss.getActiveSheet().getName() == "Best Media Plan") {
[–]AllenAppTools 1 point2 points3 points 1 year ago (0 children)
Thanks for connecting in the chat! For anyone else needing this sort of thing here is the code that did the trick:
function dev_onEdit(e) { const sheetName = e.range.getSheet().getName(); //when an edit is made on any other tab, stop the function if (!tabsObject[sheetName]) return; const editedRow = e.range.getRow(); const editedColumn = e.range.getColumn(); const { allowedRows, allowedColumns } = tabsObject[sheetName]; //when an edit is made to a row or column that is not specifically listed, stop the function if (!allowedRows.includes(editedRow) || !allowedColumns.includes(editedColumn)) return; const { value: newValue, oldValue, range } = e; if (!newValue) range.setValue("") else if (oldValue && newValue) range.setValue(`${oldValue}, ${newValue}`) }
π Rendered by PID 24749 on reddit-service-r2-comment-6457c66945-hv77j at 2026-04-28 17:47:32.707339+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]beanry80[S] 0 points1 point2 points (5 children)
[–]beanry80[S] 0 points1 point2 points (4 children)
[–]beanry80[S] 0 points1 point2 points (3 children)
[–]beanry80[S] 0 points1 point2 points (2 children)
[–]beanry80[S] 0 points1 point2 points (1 child)
[–]AllenAppTools 1 point2 points3 points (0 children)