スプレッドシートでメールを送るコードを書きました。
function myFunction() {
var spreadsheet = SpreadsheetApp.getActive()
const sheet = SpreadsheetApp.getActive().getSheetByName('MailLOG');
const recipient = sheet.getRange(2,2).getValue();
const subject = sheet.getRange(2,4).getValue();
const body = sheet.getRange(2,5).getValue();
GmailApp.sendEmail(recipient,subject,body);
}
これは成功しました。
この次に送信後セルの値のみ削除したいです。
AC40番地のセルの値を削除したいので
function clearContent() {
//スクリプトに紐づくスプレッドシートのアクティブなシートを読み込む
let sheet = SpreadsheetApp.getActiveSheet();
let delRange = sheet.getRange(40, 29);
//指定したセルを削除し、削除後、セルを左に移動させる
delRange.clearContent()()
}
と書きました。ダメでした。
素人なんですがAC40番地のセルの値を削除したい場合はどのようにかくべきでしょうか。
そして出来れば
AC40
AC41
AC42のセルの値を削除したいです。
削除は値のみでセルを左に詰めるとかはいらないです。

回答1件
あなたの回答
tips
プレビュー