View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
acces[_5_] acces[_5_] is offline
external usenet poster
 
Posts: 1
Default Delete rows that DO NOT contain certain text

Hi, it is simple, but I hope, it can work.


Sub test()
Dim Cell As Range
For Each Cell In Range("B1:B100")
Cell.Select
With Selection
Set c = .Find("login", LookIn:=xlValues)
Set d = .Find("logout", LookIn:=xlValues)
If c Is Nothing Or d Is Nothing Then
ActiveCell.EntireRow.Delete
End If
End With
Next
End Su

--
Message posted from http://www.ExcelForum.com