Create Dependent Dropdown Menus

I have 2 related tutorials here: how to create a dependent dropdown menu with a FILTER() formula and again how to do so with a script.

Sheet (to copy)


function onEdit(e){
var ss = e.source.getActiveSheet();
if (ss.getName() != “Script” || e.range.columnStart > 2) return;
var setup = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(“Setup”);
var vals = setup.getDataRange().getValues();
var rule,i;
var r = e.range.offset(0,1);
if (e.range.columnStart == 1){
i = vals[0].indexOf(e.value);
rule = SpreadsheetApp.newDataValidation()
} else if (e.range.columnStart == 2){
i = vals[1].indexOf(e.value);
rule = SpreadsheetApp.newDataValidation()



Leave a Reply

Your email address will not be published. Required fields are marked *