title: Google Script Function onEdit()
body: <p>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 <code>onEdit()</code> and store de value before altered in <code>vCellOld</code> and the new value in <code>vCellNew</code> and then, shows a messagebox whit these two values. After tha I'm trying to store the <code>vCellOld</code> in the next cell on the same line but is not working. Can anyone help me with this!?</p>
  
  <pre><code>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);
  
  }
  </code></pre>