這段代碼正是我想要的:最后一行的值。現在我試圖覆寫/替換同一最后一行中某些單元格中的這些值。我所說的“某些單元格”是指 2 個單元格,我想在其中放置來自另一個/運行良好的函式的新值。知道如何做到這一點嗎?
非常感謝您的幫助:)。
function changeCellValueInLastRow() {
var ws = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("SHEET_NAME");
var data = ws.getRange(ws.getLastRow(), 1, 1, ws.getLastColumn()).getValues();
Logger.log(data);
}
uj5u.com熱心網友回復:
function changeCellValueInLastRow(v, col = 1) {
if (v && col) {
const ss = SpreadsheetApp.getActive();
const sh = ss.getSheetByName('SHEET NAME');
sh.getRange(sh.getLastRow(), col).setValue(v);
}
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/397910.html
標籤:谷歌应用程序脚本
上一篇:多顯示幕選擇
下一篇:要寫入同一作業表的資料
