I got this code on here but need to modify it so it only sees 3 sheets.
1 is Active Tickets.
2 is Closed Tickets.
3 is Pipeline.
This is the code i currently have:
function onEdit(event)
{
var ss = SpreadsheetApp.getActiveSpreadsheet();
var actSht = event.source.getActiveSheet();
var actRng = event.source.getActiveRange();
var index = actRng.getRowIndex();
var dateCol = actSht.getLastColumn();
var lastCell = actSht.getRange(index,dateCol);
var date = Utilities.formatDate(new Date(), "GMT-3", "dd/MM/yyyy HH:mm");
lastCell.setValue(date);
lastCell.setComment("Ultima Modificacion: " + actRng.getA1Notation() +' por '+Session.getActiveUser());
ss.toast('Ultima Modificacion = '+ actRng.getA1Notation()+' por '+Session.getActiveUser());
}
Any and all help would be much appreciated
Best Answer
If I interpreted your question right you want your script run only if you edit a cell in one of the three sheets you mentioned.
You can use
getName()
onactSht
to get the name of the sheet in which you have edited a cell. The you can just use anIF
-statement to check if it's one of your sheets.Here's an example of what I described above:
And here's how you can apply it to your code: