Sub deleterows()
Application.ScreenUpdating = False
Dim srow As Long
srow = 1
Do Until srow > Cells.Find(What:="*", SearchDirection:=xlPrevious, SearchOrder:=xlByRows).Row
If InStr(1, Cells(srow, "a"), "Z:\websitepublic\", vbTextCompare) > 0 Or InStr(1, Cells(srow, "a"), "No selected documents in this directory", vbTextCompare) > 0 Then
Rows(srow).Delete
ElseIf Application.WorksheetFunction.CountA(Range(srow & ":" & srow)) = 0 Then
Rows(srow).Delete
Else
srow = srow + 1
End If
Loop
Application.ScreenUpdating = True
End Sub
|