I have been able to write my code based on answers to other questions on here however, I am stuck. I am new to coding and teaching myself as I go. I have a spreadsheet that is filled when a form is submitted. There is a date that populates into column B (date of incident). I want to add 60 days to that date for a due date. I have been able to add the 60 days but for only one cell.
I have added a menu in the Ui that has a button to run the function and it works but for that cell. I want to be able to be on the cell that I want the due date added to and when I select it in the Ui have it fill in the date. I am guessing it has something to do with .getActiveCell but I am stuck.
function setDuedate()
{
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName('2020');
var dateOfincident = new Date(sheet.getRange('B3').getValue()).getTime();
var dayInMs = 24*60*60*1000
var due = dateOfincident + (60*dayInMs)
sheet.getRange('L3').setValue(new Date(due));