通過電子郵件通知要更改的特定列中的值時,如果電子表格的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