Created
May 31, 2019 15:54
-
-
Save Tocacar/9215bf75727e13b29f6013013c3d0973 to your computer and use it in GitHub Desktop.
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 onEdit(e) { | |
new Date().toLocaleString("en-GB", {timeZone: "Europe/London"}) | |
var user = Session.getActiveUser().getEmail(); | |
var oldValue = e.oldValue | |
var sName = e.source.getActiveSheet().getSheetName(); | |
if(sName == "Standards Assurance Table") { | |
var mA1 = e.range.getA1Notation().split(":")[0]; | |
var timedate = new Date(); | |
var timestamp = Utilities.formatDate(timedate, 'Europe/London', 'yyyy-MM-dd HH:mm:ss Z'); | |
if(typeof(e.value) == 'string') { | |
var aCell = e.source.getRange(mA1); | |
var value = aCell.getValue(); | |
var form = "'" + aCell.getFormula(); | |
} else { | |
value = e.value; | |
} | |
var data = [timestamp, user, mA1, oldValue, value]; | |
e.source.getSheetByName("Change Log").appendRow(data); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment