Orquidea,
You can do it a non-macro way, using Autofilter, Custom, CCNU*. Then select the filtered
rows and delete them, then remove the Autofilter.
This macro will do it. It stops at the first empty cell it sees in the column.
Sub DeleteRows()
Const Coll = 2 ' column
Const SearchData = "CCNU"
Const StartRow = 2 ' starting row
Dim Roww As Long
Roww = StartRow
Do
If Left(Cells(Roww, Coll), Len(SearchData)) = SearchData Then
Cells(Roww, Coll).EntireRow.Delete
Else
Roww = Roww + 1
End If
Loop While Cells(Roww, Coll) <> ""
End Sub
--
Regards from Virginia Beach,
Earl Kiosterud
www.smokeylake.com
Note: Top-posting has been the norm here.
Some folks prefer bottom-posting.
But if you bottom-post to a reply that's
already top-posted, the thread gets messy.
When in Rome...