've been trying get google spreadsheet to add data into a cell automatically when another cell is edited, however I can only seem to make the onedit function work globally.
Specifically, if B2, B3, B4 etc. was edited, I would like N2, N3, N4 etc. to automatically fill with a timestamp, or the user's name.
I have been able to get the trigger working, but I cannot get an output to my cell. Here's the macro I've set up-
function onedit(event)
{
var ss = SpreadsheetApp.getActiveSheet();
var rr = SpreadsheetApp.getActiveRange();
if(ss.getIndex()!= 2)
return;
var firstRow = rr.getRow();
var lastRow = rr.getLastRow();
ss.getActiveCell().setValue(today());
}
Using setValue(today) does not seem to automatically update the cell. Any help would be greatly appreciated!
Thanks