title: VBA Code to Delete Rows if Cell is Blank Not Working
body: <p>I've put together the code below to delete rows where the cell in column E is empty. It isn't working. I think the reason is that although the cells appear to be empty when I use the formula <code>=IF(E2=&quot;&quot;,&quot;empty&quot;,&quot;not empty&quot;)</code> the result is that the cell is not empty.</p>
  <p>Can anyone suggest how to change the macro to deal with this?</p>
  <pre><code>Sub DeleteRow()
      Dim r As Long
      Dim LastRow As Long
      LastRow = ThisWorkbook.Worksheets(&quot;List&quot;).Cells(Rows.Count, &quot;E&quot;).End(xlUp).Row
      For r = LastRow To 1 Step -1
          If Cells(r, 1) = &quot;&quot; Then
              Rows(r).Delete
          End If
      Next r
  End Sub
  </code></pre>