0

Ok -- So I've been stumped for quite some time now and am seeking help to what should be a super easy problem... I have 3 different Sheets within a Google Sheets file... On each of the sheets I want to have one cell which basically creates a TimeStamp when another cell is modified.

So I know I am close as with copy/paste between what I've found here I can have this working for 1 of the 3 sheets (the last one listed) but for can't figure out how to get it working on all the sheets.

Please help!

Screenshot

function onEdit(e) {
  var cols = [1];
  if(e.source.getActiveSheet().getName() !== 'OFFERS' || cols.indexOf(e.range.columnStart) == -1) return;
  e.range.offset(0, 3).setValue(typeof e.value !== 'object' ? new Date() : null)
}

function onEdit(e) {
  var cols = [1];
  if(e.source.getActiveSheet().getName() !== 'BIDS' || cols.indexOf(e.range.columnStart) == -1) return;
  e.range.offset(0, 1).setValue(typeof e.value !== 'object' ? new Date() : null)
}

function onEdit(e) {
  var cols = [1];
  if(e.source.getActiveSheet().getName() !== 'LEADS' || cols.indexOf(e.range.columnStart) == -1) return;
  e.range.offset(0, 1).setValue(typeof e.value !== 'object' ? new Date() : null)
}
Rubén
  • 34,714
  • 9
  • 70
  • 166
Rob
  • 11
  • 3
    You can only have a single function with any given name. Consider using an `if-else if` logic flow. – tehhowch Jul 23 '18 at 21:04
  • 4
    Possible duplicate of [Two OnEdit functions not working together](https://stackoverflow.com/questions/27030085/two-onedit-functions-not-working-together) – Rubén Jul 24 '18 at 01:28
  • 1
    Also see: https://productforums.google.com/forum/#!topic/docs/D8CTGklLUwU;context-place=forum/docs – JPV Jul 24 '18 at 06:52

0 Answers0