title: What I'm doing wrong in reset Cell value excel
body: <p>As I'm, deeply new to excel programming I figure out a macro that help me validate cells and set cells to false if the value in another cell do not allow it </p>
  
  <pre><code>   Private Sub Worksheet_Change(ByVal Target As Range)
   ActiveSheet.Unprotect
  Range("W" &amp; (ActiveCell.Row)).Locked = False
  Range("Y" &amp; (ActiveCell.Row)).Locked = False
  Range("Z" &amp; (ActiveCell.Row)).Locked = False
  Range("C" &amp; (ActiveCell.Row)).Locked = False
  If Range("U" &amp; (ActiveCell.Row)).Value = "Controlled Good" Then
  Range("W" &amp; (ActiveCell.Row)).Locked = True
  End If
  </code></pre>
  
  <p>But I want to reset the value of the none wanted cell back to empty , so I tried </p>
  
  <pre><code> If Range("U" &amp; (ActiveCell.Row)).Value = "Controlled Good" Then
  Range("W" &amp; (ActiveCell.Row)).value=""
  Range("W" &amp; (ActiveCell.Row)).Locked = True
  </code></pre>
  
  <p>But I'm receiving an error , what I'm doing wrong? </p>
  
  <p>thanks</p>