Thread: Coding
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Patrick Dave Patrick is offline
external usenet poster
 
Posts: 249
Default Coding

For r = 100 To 1 Step -1
If LCase(Trim(Cells(r, 2).Text)) = "abc" Then
Cells(r & "," & r).EntireRow.Delete
End If
Next

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"Ed" wrote:
| For some reason the code does not work. Please check to see if code
| covers my problem in words as follows:
|
| I have about a hundred lines in an excel file. Some of the cells in
| column B contain the letters abc.
|
| What is the code to delete the rows with the letters abc in column B?