title: Filling empty cells - VBA
body: <p>I'm trying to fill empty cells in a specified range. I have used code taken from other questions to write this:</p>
  <pre><code>Dim rCell As Range
  
  For Each rCell In ws.Range(&quot;E36:G45&quot;)
      If IsEmpty(rCell.Value) = True Or IsNull(rCell.Value) = True Or rCell.Value = &quot;&quot; Then
      rCell.Value = -999
      End If
  Next rCell
  </code></pre>
  <p>This doesn't work, neither does the following (where the Boolean is removed):</p>
  <pre><code>For Each rCell In ws.Range(&quot;E36:G45&quot;)
      If IsEmpty(rCell.Value) Or IsNull(rCell.Value) Or rCell.Value = &quot;&quot; Then
      rCell.Value = -999
      End If
  Next rCell
  </code></pre>
  <p>The range E36:G45 contains a mix of empty and non-empty cells.</p>
  <p>I have tried clearing the contents.</p>
  <p>There are no sub procedures that could make the cells un-editable.</p>