title: Macro to delete rows from columns that have less that 4 characters
body: <p>I am using the following code to try and delete entire rows when it has less than 4 characters in the specific "NAME" column. (ie a column with the header in row 1 being NAME) The database currently has around 10,000 rows. I know the code right now is close, but I am getting a VB error when trying to run it. I think I might be searching for the specific column by name wrong.</p>
  
  <pre><code>Sub Macro2()
  
  ' Macro to delete rows if there are less than 4 in the NAME column
  
      Dim LR As Long, i As Long
      Application.ScreenUpdating = False
      LR = Range("NAME" &amp; Rows.Count).End(xlUp).Row
      For i = LR To 1 Step -1
          If Len(Range("NAME" &amp; i).Value) &lt; 4 Then Rows(i).Delete
      Next i
      Application.ScreenUpdating = True
  
  End Sub
  </code></pre>
  
  <p>Edit: I am getting the VBA error in the following line:</p>
  
  <pre><code>LR = Range("NAME" &amp; Rows.Count).End(xlUp).Row
  </code></pre>