Google Sheets: Hiding Rows Based on Cell Value
<p>I am very new to Google scripts and have reviewed similar questions to the one I am asking now, but cannon seem to retro fit prior advice into what I'm looking to do. I have a simple "Yes/No" drop down in cell A2 of my sheet. If "Yes" is selected, I would like to hide row 5 and 7. I have been working on the below:   </p>

<pre><code> Prior Year my onEdit(e) {
  Logger.log('e.value: ' + e.value);

 var cellEdited = e.range.getA1Notation();
 Logger.log('cellEdited: ' + cellEdited);

if (cellEdited === "A2" &amp;&amp; e.value === "yes") {

var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName("TX MD 2017");
var maxRows = sheet.getMaxRows();

theSheet.hideRows(5,7);
 };
}
</code></pre>

<p>Any assistance or nudges would be very helpful. </p>