tdm,
Here's one way...
Sub FindDelete()
Dim ws As Worksheet
Dim rngFound As Range
Dim rngDelete As Range
Dim oShell As Object
Dim arrFind As Variant
Dim varFind As Variant
Dim strFolderPath As String
Dim strCurrentFile As String
Dim strFirst As String
'Adjust the search terms here as shown, they are not case sensitive
arrFind = Array("internet", "release", "date")
Set oShell = CreateObject("Shell.Application").BrowseForFolder(0, "Select Folder", 0)
On Error Resume Next
strFolderPath = oShell.Self.Path
Set oShell = Nothing
On Error GoTo 0
If Len(strFolderPath) = 0 Then Exit Sub 'Pressed cancel
strFolderPath = strFolderPath & Application.PathSeparator
strCurrentFile = Dir(strFolderPath & "*.xls*")
Application.ScreenUpdating = False
Do
With Workbooks.Open(strFolderPath & strCurrentFile)
For Each varFind In arrFind
For Each ws In .Sheets
Set rngFound = ws.UsedRange.find("*" & varFind & "*", ws.UsedRange.Cells(ws.UsedRange.Cells.Count), xlValues, xlWhole)
If Not rngFound Is Nothing Then
strFirst = rngFound.Address
Set rngDelete = rngFound
Do
Set rngDelete = Union(rngFound, rngDelete)
Set rngFound = ws.UsedRange.find("*" & varFind & "*", rngFound, xlValues, xlWhole)
Loop While rngFound.Address <> strFirst
rngDelete.EntireRow.Delete
Set rngFound = Nothing
Set rngDelete = Nothing
strFirst = vbNullString
End If
Next
Next
.Close True
End With
Loop While Len(strCurrentFile) > 0
Application.ScreenUpdating = True
Set ws = Nothing
Erase arrFind
End Sub
Bookmarks