title: Apps Script run onEdit on specific tab/sheet only
body: <p>I'm sure there is a very simple answer to this question;</p>
  <p>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.</p>
  <pre><code>function onEdit(e) {
  if (e.range.getSheet().getName() != &quot;PrintNoteLines&quot;) {  
    return}
      var sh = e.source.getActiveSheet()
      if (sh.getName().indexOf('PrintNoteLines') &gt; -1 &amp;&amp; e.range.getA1Notation() == 'B1' &amp;&amp; e.value) {
          sh.getRange('A25:A183')
                  .setDataValidation(SpreadsheetApp.newDataValidation()
                  .requireValueInRange(e.source.getRangeByName(e.value), true)
                  .setAllowInvalid(false)
                  .build());                                                                         }
                          }
  </code></pre>