Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Automatically puts the current date in the first column of the edited row
- */
- function onEdit(event){
- var sheet = event.source.getActiveSheet();
- var debugCell = sheet.getCell(10,10);
- debugCell.setValue("DEBUG CELL"); // if anything works, this should show up... but it doesn't :C
- var editedCell = sheet.getActiveCell();
- var dateCol = 0;
- var dateCell = sheet.getCell(editedCell.getRow(), dateCol);
- debugCell.setValue(editedCell.getColumn());
- if(!dateCell.getValue() && editedCell.getColumn() != dateCol){
- dateCell.setValue(new Date());
- }
- }
- function onEdit(event){
- var sheet = event.source.getActiveSheet();
- var debugCell = sheet.getRange(10,10);
- debugCell.setValue("DEBUG CELL"); // if anything works, this should show up... but it doesn't :C
- var editedCell = sheet.getActiveCell();
- var dateCol = 1;
- var dateCell = sheet.getRange(editedCell.getRow(), dateCol);
- debugCell.setValue(editedCell.getColumn());
- if(!dateCell.getValue() && editedCell.getColumn() != dateCol){
- dateCell.setValue(new Date());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement