Skip to content

Instantly share code, notes, and snippets.

@Yamotty
Last active December 8, 2016 02:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Yamotty/b3905259471d2081ac89 to your computer and use it in GitHub Desktop.
Save Yamotty/b3905259471d2081ac89 to your computer and use it in GitHub Desktop.
[超簡単] spreadsheetを更新したら自動で更新日付を入れるGAS ref: http://qiita.com/Yamotty/items/888ae6f93a05a8cfc16f
function insertLastUpdated() {
var ss = SpreadsheetApp.getActiveSheet();
var currentRow = ss.getActiveCell().getRow();
var currentCell = ss.getActiveCell().getValue();
var updateRange = ss.getRange('F' + currentRow) //更新日をいれる列をstringで指定。この場合はF列
Logger.log(updateRange);
//更新日の記入
if(currentRow>1){
if(currentCell) {
updateRange.setValue(new Date());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment