View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Ken G Ken G is offline
external usenet poster
 
Posts: 34
Default Macro to delete rows

Thanks Jacob. Perfect.

"Jacob Skaria" wrote:

Try

Sub MyMacro()
Dim lngRow As Long
For lngRow = Cells(Rows.Count, "A").End(xlUp).Row To 2 Step -1
If Len(Range("A" & lngRow)) 5 Then Rows(lngRow).Delete
End If
Next
End Sub

--
Jacob


"Ken G" wrote:

I need a macro to search through a sheet of approximately 5,000 rows and
delete any row where the length of the string in column A is greater than 5.
I'm using Excel 2003. Can anyone help?