03 June 2015

Monitor an individual cell in Sheets

1. Go to the spreadsheet.
2. Tools - Script Editor
3. Paste in this:

function checkEdits() {
  var thisSS = SpreadsheetApp.getActiveSpreadsheet();
  var sheet1 = thisSS.getSheetByName('Sheet1');
//  Change this cell to whichever one you want to 
//  watch.
  var specialCell = sheet1.getRange("A1");
  if (thisSS.getActiveCell().getA1Notation() == specialCell.getA1Notation()) {
    var htmlEmail = "Cell " + specialCell.getA1Notation() + 
      " edited by " + Session.getActiveUser().getEmail();
    GmailApp.sendEmail("YOUR EMAIL HERE", "Spreadsheet Update " + new Date(), "", {htmlBody:htmlEmail} );
  
  }
}

No comments:

Post a Comment