Dim LastRow as long
dim i As long
With activesheet
'just look at the rows that are used
lastrow = .cells(.rows.count,"A").end(xlup).row
For i = lastrow to 1 Step -1
If len(.cells(i,"A").value) < 11 then
.Rows(i).Delete
End If
Next i
End with
John Keith wrote:
I want to loop through the data in column A and if the text length of
the contents of the cell is not equal to 11 I want to delete the row.
Here's what I have that is not working (error is function not
compatible with object or something to that effect):
For i = Range("A:A").Rows.Count To 1 Step -1
If WorksheetFunction.Len(Range("A:A").Rows(i)) < 11 Then
Range("A:A").Rows(i).EntireRow.Delete
End If
Next i
Can someone point out what I'm doing wrong, or suggest a better
method?
Thanks
John Keith
--
Dave Peterson