Skip to content

Instantly share code, notes, and snippets.

@tkota0726
Created March 17, 2018 07:01
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 tkota0726/c983b476c88759ed4795d05ff75936ee to your computer and use it in GitHub Desktop.
Save tkota0726/c983b476c88759ed4795d05ff75936ee to your computer and use it in GitHub Desktop.
GoogleAppScript_日付自動挿入スクリプト
function insertLastUpdated() {
var ss = SpreadsheetApp.getActiveSheet();//現在触っているシートを取得
var currentRow = ss.getActiveCell().getRow(); //アクティブなセルの行番号を取得
var currentCell = ss.getActiveCell().getValue(); //アクティブなセルの入力値を取得
var updateRange = ss.getRange('A' + currentRow) //どの列に更新日時を挿入したいか。この場合はA列
Logger.log(updateRange);
//更新日の記入
if(currentRow>10){ //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