title: clear a cell based on the contents of another cell
body: <p>I have on a google spreadsheet on the sheet &quot;SUIVI ANIM&quot;, a column Y whose each cell contains from line 5, a drop-down menu. Then I have in column Z a small &quot;x&quot;. I would like that when in column Y, it is &quot;Submit LEAD&quot; which is selected that automatically the small &quot;x&quot; of column Z is erased.
  For example, if &quot;Submit LEAD&quot; in Y3 then Z3 is empty. If &quot;Submit LEAD&quot; in Y4 then Z4 empties etc.</p>
  <p>I searched and found this script:</p>
  <pre><code>function onEdit(e) {
  
    var ss = SpreadsheetApp.getActiveSpreadsheet();
    var sheet = ss.getActiveSheet();
    
    // identify the range and values to watch and clear
    var watchCol = 25; // Column Y
    var watchValue = &quot;Submit LEAD&quot;;
    var clearCol = 26; // Column Z
    // 
  
    // Logger.log(&quot;DEBUG: the column = &quot;+e.range.columnStart+&quot;, and the value = &quot;+e.value)
    if (e.range.columnStart === watchCol &amp;&amp; e.value === watchValue) {
      // Logger.log(&quot;DEBUG: the conditions were met&quot;);   
      sheet.getRange(e.range.rowStart, clearCol).clearContent()
    }
    return false;
  }
  </code></pre>
  <p>But it doesn't work and the debug tells me it's wrong from the line: <code>if (e.range.columnStart === watchCol &amp;&amp; e.value === watchValue) {</code></p>
  <p>I'm new to scripting and I'm French so sorry if I'm not very clear.</p>
  <p>Thanks for any help you could give me.
  émilie</p>