title: How to make Google Script run for all users of the Sheet
body: <p>I have built a Sheet that uses the script below to move rows from one tab to another, based on the selection made in a column. For example, if the selection in this column is changed to CLOSED, the entire row gets moved to the CLOSED tab.  If it is changed to DEAD, it gets moved to the DEAD tab.</p>
  
  <p>The problem though, is it only works when I do it, but not when any of the other collaborators change the cell.  Here is the code:</p>
  
  <pre><code>function onEdit(e) {
    var ss = e.source;
    var activatedSheetName = ss.getActiveSheet().getName();
    var activatedCell = ss.getActiveSelection();
    var activatedCellRow = activatedCell.getRow();
    var activatedCellColumn = activatedCell.getColumn();
    var activatedCellValue = activatedCell.getValue();
  
    var preclosingTrackerSheet = ss.getSheetByName("PRECLOSING"); // source sheet
    var closingTrackerSheet = ss.getSheetByName("CLOSING"); // target sheet
    var closedTrackerSheet = ss.getSheetByName("CLOSED FILES"); // target sheet
    var deadTrackerSheet = ss.getSheetByName("DEAD FILES"); // target sheet
  
    // if the value in column AG is "2-Closing", and you are in the PRECLOSING Sheet, MOVE the row to CLOSING sheet
    if (activatedSheetName == preclosingTrackerSheet.getName() &amp;&amp; activatedCellColumn == 33 &amp;&amp; activatedCellValue == "2-Closing") {
      // insert a new row at the second row of the target sheet
      closingTrackerSheet.insertRows(2,1);
  
      // copy the entire source row to the second row of target sheet
      var rangeToMove = preclosingTrackerSheet.getRange(/*startRow*/ activatedCellRow, /*startColumn*/ 1, /*numRows*/ 1, /*numColumns*/ preclosingTrackerSheet.getMaxColumns());
      rangeToMove.moveTo(closingTrackerSheet.getRange("A2"));
  
      // delete row from source sheet
      preclosingTrackerSheet.deleteRows(activatedCellRow,1);
  
    }
  
    // if the value in column AG is "CLOSED", and you are in the PRECLOSING Sheet, MOVE the row to CLOSED sheet
    if (activatedSheetName == preclosingTrackerSheet.getName() &amp;&amp; activatedCellColumn == 33 &amp;&amp; activatedCellValue == "3-Closed") {
      // insert a new row at the second row of the target sheet
      closedTrackerSheet.insertRows(2,1);
      // move the entire source row to the third row of target sheet
      var rangeToMove = preclosingTrackerSheet.getRange(/*startRow*/ activatedCellRow, /*startColumn*/ 1, /*numRows*/ 1, /*numColumns*/ preclosingTrackerSheet.getMaxColumns());
      rangeToMove.moveTo(closedTrackerSheet.getRange("A2"));
  
      // delete row from source sheet
      preclosingTrackerSheet.deleteRows(activatedCellRow,1);
    }
  
  
    // if the value in column AG is "DEAD", and you are in the PRECLOSING Sheet, MOVE the row to DEAD sheet
    if (activatedSheetName == preclosingTrackerSheet.getName() &amp;&amp; activatedCellColumn == 33 &amp;&amp; activatedCellValue == "x-Dead") {
      // insert a new row at the second row of the target sheet
      deadTrackerSheet.insertRows(2,1);
      // move the entire source row to the third row of target sheet
      var rangeToMove = preclosingTrackerSheet.getRange(/*startRow*/ activatedCellRow, /*startColumn*/ 1, /*numRows*/ 1, /*numColumns*/ preclosingTrackerSheet.getMaxColumns());
      rangeToMove.moveTo(deadTrackerSheet.getRange("A2"));
  
      // delete row from source sheet
      preclosingTrackerSheet.deleteRows(activatedCellRow,1);
    }
  
    // if the value in column AG is "PRECLOSING", and you are in the CLOSING Sheet, MOVE the row to PRECLOSING sheet
    if (activatedSheetName == closingTrackerSheet.getName() &amp;&amp; activatedCellColumn == 33 &amp;&amp; activatedCellValue == "1-Preclosing") {
      // insert a new row at the second row of the target sheet
      preclosingTrackerSheet.insertRows(2,1);
  
      // move the entire source row to the third row of target sheet
      var rangeToMove = closingTrackerSheet.getRange(/*startRow*/ activatedCellRow, /*startColumn*/ 1, /*numRows*/ 1, /*numColumns*/ closingTrackerSheet.getMaxColumns());
      rangeToMove.moveTo(preclosingTrackerSheet.getRange("A2"));
  
      // delete row from source sheet
      closingTrackerSheet.deleteRows(activatedCellRow,1);
    }
  
    // if the value in column AG is "CLOSED", and you are in the CLOSING Sheet, MOVE the row to CLOSED sheet
    if (activatedSheetName == closingTrackerSheet.getName() &amp;&amp; activatedCellColumn == 33 &amp;&amp; activatedCellValue == "3-Closed") {
      // insert a new row at the second row of the target sheet
      closedTrackerSheet.insertRows(2,1);
      // move the entire source row to the third row of target sheet
      var rangeToMove = closingTrackerSheet.getRange(/*startRow*/ activatedCellRow, /*startColumn*/ 1, /*numRows*/ 1, /*numColumns*/ closingTrackerSheet.getMaxColumns());
      rangeToMove.moveTo(closedTrackerSheet.getRange("A2"));
  
      // delete row from source sheet
      closingTrackerSheet.deleteRows(activatedCellRow,1);
    }
  
  
    // if the value in column AG is "DEAD", and you are in the CLOSING Sheet, MOVE the row to DEAD sheet
    if (activatedSheetName == closingTrackerSheet.getName() &amp;&amp; activatedCellColumn == 33 &amp;&amp; activatedCellValue == "x-Dead") {
      // insert a new row at the second row of the target sheet
      deadTrackerSheet.insertRows(2,1);
      // move the entire source row to the third row of target sheet
      var rangeToMove = closingTrackerSheet.getRange(/*startRow*/ activatedCellRow, /*startColumn*/ 1, /*numRows*/ 1, /*numColumns*/ closingTrackerSheet.getMaxColumns());
      rangeToMove.moveTo(deadTrackerSheet.getRange("A2"));
  
      // delete row from source sheet
      closingTrackerSheet.deleteRows(activatedCellRow,1);
    }  
  
  }
  </code></pre>
  
  <p>How do I tell the script to run for all users on this Sheet?</p>