I am trying to have one column that will show the most recent thing i entered in the row. Example: I want B2 to be the same as D2 but once I enter something in E2 I want B2 to display that. And then if I entered something in F3 it would then show in B2 and so on and so fourth. I figured out how to do it with one cell doing a "=index(d2)" and tried something like "=index(D2:L2) for the sequence but it only shows d2 or gets upset and causes errors. I hope that makes sense. It seems simple enough but after researching it I've been unable to find anything. It is mainly text that I am trying to display and not numbers.


The following little script will add each change you make, in the active row, to column B:

function onEdit() {
  var sh = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  var row = sh.getActiveCell().getRowIndex();
  var value = sh.getActiveCell().getValue();
  sh.getRange(row, 2).setValue(value);

See example file I created, you you to play around with: onEdit change

Goto Tools, Script Editor, from the menu and add the script. Make sure to press the two buttons:
enter image description here

  • Oh my goodness you're amazing! Thank you so much! Would you happen to know how to copy the notes associated with that cell to be referenced as well? would I do the same script but replace "cell" with note maybe? Anyways, thanks so much again! Mar 27 '13 at 14:43
  • also one more little thing, is there any way to make it so the cells preceding it don't affect the cell? ex: When ever I change something in row "A", "b" won't change unless it's something in row "c" or further? Mar 27 '13 at 15:09
  • @jasonlindsay best is to ask those questions, separately. Apr 5 '13 at 20:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.