0

I'm trying to use a script to allow for multiple items to be selected from drop down lists in multiple columns. Here is the script I have used - it works perfectly for one column, but I can figure out how to apply the script to multiple columns.

function onEdit(e) {
var oldValue;
var newValue;
var ss=SpreadsheetApp.getActiveSpreadsheet();
var activeCell = ss.getActiveCell();
if(activeCell.getColumn() == 10  && ss.getActiveSheet().getName()=="DASH") {
newValue=e.value;
oldValue=e.oldValue;
if(!e.value) {
activeCell.setValue("");
}
else {
if (!e.oldValue) {
activeCell.setValue(newValue);
}
else {
if(oldValue.indexOf(newValue) <0) {
activeCell.setValue(oldValue+', '+newValue);
}
else {
activeCell.setValue(oldValue);
}
}
}
}
}

0 Answers0