I'm new and playing around with Google sheet app script.
i'm trying to sheet on onEdit trigger for only one cell (B5). It contains a dropdown list. When staff selects the month (eg. May), it runs the May() script.
The below code works. But when i add an if() it suddenly stops.
Any help will be appreciated!
function onEdit(e) {
let ss = SpreadsheetApp;
let activeSheet = ss.getActive().getActiveSheet();
let dropDownCell = activeSheet.getRange('B5').getValue();
if (dropDownCell == 'January'){ return Jan() };
if (dropDownCell == 'February'){ return Feb() }
if (dropDownCell == 'March'){ return Mar() };
if (dropDownCell == 'April'){ return Apr() };
if (dropDownCell == 'May'){ return May() };
if (dropDownCell == 'June'){ return Jun() };
if (dropDownCell == 'July'){ return Jul() };
if (dropDownCell == 'August'){ return Aug() };
if (dropDownCell == 'September'){ return Sep() };
if (dropDownCell == 'October'){ return Oct() }
if (dropDownCell == 'November'){ return Nov() };
if (dropDownCell == 'December'){ return Dec() };
}```