Created
March 17, 2018 07:01
-
-
Save tkota0726/c983b476c88759ed4795d05ff75936ee to your computer and use it in GitHub Desktop.
GoogleAppScript_日付自動挿入スクリプト
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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