Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to assign onEdit to specigfic tab

function onEdit(e) {
    var activeSheet = e.source.getActiveSheet();
    var range = e.range;
    if (activeSheet.getName() !== "Inventory" || e.value !== "notify") return;
    range.setBackgroundColor('red');
    var productname = range.offset(0, -3).getValue();
    var productinventory = range.offset(0, -2).getValue();
    var message = "Product variant " + productname + " has dropped to " + productinventory;
    var subject = "Low Stock Notification";
    var emailAddress = "email@email.com";
    MailApp.sendEmail(emailAddress, subject, message);
    range.offset(0, 1).setValue("notified");
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #assign #onEdit #specigfic #tab
ADD COMMENT
Topic
Name
5+9 =