Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let dict =
- {
- 'Лист1': { colFrom: 1, colTo: 5, rowFrom: 1, rowTo: 5 },
- 'Лист2': { colFrom: 1, colTo: 5, rowFrom: 1, rowTo: 5 }
- };
- function onEdit(e) {
- let [shName, row, col] = [e.source.getSheetName(), e.range.getRow(), e.range.getColumn()]
- if (e.value != e.oldValue
- && shName in dict
- && dict[shName].colFrom <= col && dict[shName].colTo >= col
- && dict[shName].rowFrom <= row && dict[shName].rowTo >= row
- ) {
- let ss = e.source;
- let sh = ss.getSheetByName('лог') || ss.insertSheet('лог');
- let email = Session.getEffectiveUser().getEmail();
- let log_data = [e.source.getSheetName(), e.range.getA1Notation(), e.value, e.oldValue, email, new Date()];
- sh.appendRow(log_data);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement