Conversation started Mar 6, 2014 at 20:52.
Mar 6, 2014 20:52
@VidarS.Ramdal Can you please check my code?
Mar 6, 2014 21:13
@JacobJanTuinstra Yeah, e.source.getActiveSheet().getSheetId() seems wrong
maybe it should have been e.source.getActiveSheet().getIndex()?
which is, apparently, 1-based, so the first sheet will have index 1
 
10 hours later…
Mar 7, 2014 07:27
@VidarS.Ramdal the getSheetId retrieves the Id of the sheet (zero based). Statement was made to be != 0. The code works just fine.
@VidarS.Ramdal Having read the explanation on the GAS website, I think the getIndex is more logical for people to understand.
Mar 7, 2014 08:17
@JacobJanTuinstra Oh yes, ´getSheetId´ wasn't what I thought it was. On the other hand, the number returned by getSheetId is assigned at creation time, so I guess it is a matter of definition what is the "first" sheet.
Mar 7, 2014 08:50
@VidarS.Ramdal Good reading. Just tested it and it is indeed the creation date.
@VidarS.Ramdal I learned something today !!
:) Me too!
 
Conversation ended Mar 7, 2014 at 8:53.