以獲取工作表中的當前日期。 你必須計算從1月1日到今天的天數。 使用Sheet.getRange(row, col, numRows, numCol)的col參數中的天數+1月1日單元格之前使用的列數。 在這里,我創建了一個代碼,在user2501097的幫助下,用當前日期激活單元格: function myFunction() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var snoopiSheet = ss.getSheetByName("Snoopi"); var range = snoopiSheet.getRange(5, getCurrentDayofYear() + 5, 1,1); range.activate();}function getCurrentDayofYear(){ var date = new Date(); return (Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()) - Date.UTC(date.getFullYear(), 0, 0)) / 24 / 60 / 60 / 1000;} Output: 注意:我在上面的例子中使用了Snoopi sheet,我在getRange()的第二個參數中添加了+5,因為計