Using Java, I'm trying to find the cells that contain any text, take that data and get it onto an array then use these for a dropdown data validation cell.
I've tried various different methods of creating the array but each one didn't create the dropdown cell, leaving it blank.
var carerList=new Array();
for (var i=19;sheet.getRange('G'+[i])!="";i++){
var j=0;
carerList[j].push(sheet.getRange('G'+[i]).getValue());
j++;
}
var dV=sheet.getRange('G2').getDataValidation();
dV.setAllowInvalid(false);
dV.requireValueInList(carerList, true);
sheet.getRange("G2").setDataValidation(dV);
I want a nice little data validation in G2 that doesn't have any blank values.
requireValueInRange