I'm sure there is a very simple answer to this question;
I have a function that works perfectly, however it only works if the function name is 'onEdit' which is not what i want as i want to create similar functions for different tabs, hence the first line checking the sheet name, can someone please point out the error of my ways :-) thanks.
function onEdit(e) {
if (e.range.getSheet().getName() != "PrintNoteLines") {
return}
var sh = e.source.getActiveSheet()
if (sh.getName().indexOf('PrintNoteLines') > -1 && e.range.getA1Notation() == 'B1' && e.value) {
sh.getRange('A25:A183')
.setDataValidation(SpreadsheetApp.newDataValidation()
.requireValueInRange(e.source.getRangeByName(e.value), true)
.setAllowInvalid(false)
.build()); }
}