Select Range from Active Cell for Multiple Dropdown

Viewed 53

This script allows me to append multiple values to a single cell by appending the drop down options.

However I'd like to apply this script to the entire F row, currently only works on F2, how do I update this to a range?

function onEdit(e) {
var oldValue;
var newValue;
var ss=SpreadsheetApp.getActiveSpreadsheet();
var activeCell = ss.getActiveCell();
if(activeCell.getColumn() == 6 && activeCell.getRow() == 2 && ss.getActiveSheet().getName()=="Data") {
newValue=e.value;
oldValue=e.oldValue;
if(!e.value) {
activeCell.setValue("");
}
else {
if (!e.oldValue) {
activeCell.setValue(newValue);
}
else {
activeCell.setValue(oldValue+', '+newValue);
}
}
}
}
1 Answers

Try changing this line:

if(activeCell.getColumn() == 6 && activeCell.getRow() == 2 && ss.getActiveSheet().getName()=="Data") {

to this:

if(activeCell.getColumn() == 6 && ss.getActiveSheet().getName()=="Data") {
Related