title: Google Sheets OnEdit Function for multiple sheets
body: <p>I have multiple tabs in a single sheet and when the word HIDE is in column A, I want the row to be hidden when the sheet is edited. The below works great for a single named sheet (SHEET1) but I want it to check all sheets.</p>
  
  <p>I can add the below function multiple times naming each sheet in each function and it works but I will continue to add additional sheets later and don't want to have to add another function for each tab I add.</p>
  
  <pre><code>function onEdit(e) {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var s = ss.getSheetByName("SHEET1");      // This only allows me to check 1 sheet by name
    var row=s.getRange('A:A').getValues();          // This looks for the value in column A that hides that row if true
  
  s.showRows(1, s.getMaxRows());
  for(var i=0; i&lt; row.length; i++){ if(row[i] == 'HIDE') { s.hideRows(i+1, 1); }   // This is the value to hide
  
  }}
  </code></pre>