Web Applications Stack Exchange is a question and answer site for power users of web applications. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I created an onEdit script which re-sorts a Google Spreadsheet every time a cell is edited.

The Google Spreadsheet is shared amongst multiple users and I'd like the script to run for all users, every time the spreadsheet is opened.

How do I set this up?

share|improve this question
You must use the on open function first, and call for the sort function. – Jacob Jan Tuinstra Mar 13 '13 at 6:42
See following answer I gave: webapps.stackexchange.com/a/36352/29140 – Jacob Jan Tuinstra Mar 13 '13 at 6:46
up vote 1 down vote accepted

It turned out that a bug in my script was stopping it from running. For anyone who stumbles across this question trying to solve a similar problem here is my working script:

function onEdit(event){
  var sheet = event.source.getActiveSheet();
  var editedCell = sheet.getActiveCell();

  var tableRange = "A2:F999";

  if(editedCell.getColumn() == 6){   
    var range = sheet.getRange(tableRange);
    range.sort([{column: 6}, {column: 4}, {column: 5}]);
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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