I'm learning how to use the google apps scripts with google sheets, and im using the script below to test. What it basic do is call the function onEdit() and store de value before altered in vCellOld and the new value in vCellNew and then, shows a messagebox whit these two values. After tha I'm trying to store the vCellOld in the next cell on the same line but is not working. Can anyone help me with this!?
function onEdit(e)
{
//Store the old value
var vCellOld = e.oldValue;
//Store the new value
var vCellNew = e.value;
//Shows a message box with the old and new values
Browser.msgBox("valor antigo: " + vCellOld + " valor novo: " + vCellNew);
//HERE SHOULD STORE THE OLD VALUE ON THE NEXT RESPECTIVE CELL
var nCell = e.range.Offset(0,1);
ncell.setValue(vCellOld);
}


Range#Offset. Did you meanRange#offset? - tehhowchnCellis with c lowecase. I fixed and didn't work too!var nCell = e.range.offset(0,1); nCell.setValue(vCellOld);- Stephen Willians