Currently building a function where when a certain selection is selected from a drop-down data validation menu, the user is redirected to a different sheet within the workbook. What I currently have does not return an error but also does not do what is intended. Any help would be greatly appreciated.
function gotoselectsheetnosheet() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getActiveSheet();
var range = sheet.getRange(4,3);
var data = range.getValue();
if (data == "Answers")
{
var dinner = ss.getSheetByName('Answers');
dinner.activate();
}
}