I'm trying to figure a way to add DataValidation with named range name as "Range" value. Using getRangeByName in requireValueInRange provides me with just "A1:A50" while i need to find a way to put "SampleRange" (which is range name) in it's place. It is possible to do manually but i have 300 rows to update one by one and i need a way to automate it.
function ValidationNamedRange() {
var NameSpace = "SampleRange";
var rule = SpreadsheetApp.newDataValidation().requireValueInRange(NameSpace).build();
range.setDataValidation(rule);
}
}
Thanks for the help!
GetRangeByNameandRequireValueInRangewill throw syntax errors.