title: Conditional Delete in VBA
body: <p>I am trying to piece together code to make my macro work correctly. This approach has served me well in the past but I cannot seem to adapt any code correctly. </p>
  
  <p>I found the following</p>
  
  <pre><code>Sub way()
  
  Dim Cell As Range
  For Each Cell In Range("A1").CurrentRegion
      If Len(Cell) &lt; 2 Then Cell.EntireRow.Delete
  Next Cell
  
  End Sub
  </code></pre>
  
  <p>I can adapt the If Len(Cell) criteria to my liking. For example = 10 </p>
  
  <p>I do not know how to adapt the code to make it search through all cells in column A and delete the appropriate rows. The code above only does it for A1. </p>
  
  <p>Ideally I would like to delete all rows with cells in column A that have a length of 10 characters. Or alternatively, with a completely different set of code, delete all other rows that do not contain cells in column A that have a length of 10 characters. </p>