通过电子邮件通知要更改的特定列中的值时,如果电子表格的AQ列中的任何单元格发生更改,我需要通过电子邮件通知。我写了一个不工作的公式。使用脚本编辑器
电子表格和公式的图像如下。
function onEdit(e){
//To get email notification if any changes to the perticular cells
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName("Notificações");
var cell = ss.getActiveCell().getA1Notation();
var row = sheet.getActiveRange().getRow();
var cellvalue = ss.getActiveCell().getValue().toString();
var recipients = "[email protected]";
var message = '';
if(cell.indexOf('AQ')!=-1) { // means that if you edit column AQ
message = sheet.getRange('AQ'+
sheet.getActiveCell().getRowIndex()).getValue()
}
}
var subject ='Notificação de Alta Prioridade '
var body =' Você acaba de receber uma notificação de alta prioridade. Acesse sua planilha de notificações para que possa elaborar uma tratativa'
Logger.log(body);
//MailApp.sendEmail("[email protected]","Notificação de alta prioridade","Você acaba de receber uma notificação de alto risco, acesse sua planilha de notificações para que possa elaborar uma tratativa;
请转换代码的文本,并将其放置在你的问题。图像令人不悦。 – axlj
另外一些谷歌搜索产生这样的:http://www.makeuseof.com/tag/send-emails-excel-vba/ – axlj