Hello,
Please try this code, I hope it helps:
Sub DeleteNotNecessaryRows()
'Author: MaczaQ
'Thread: http://www.excelforum.com/excel-programming/795683-delete-rows-not-matching-certain-criteria.html
Dim first, last As Long, col As Integer, cell As String
col = 1 'column index for check
first = 1
last = ActiveSheet.Columns(col).Find(what:="*", SearchDirection:=xlPrevious).Row
For r = last To first Step -1
cell = Cells(r, col)
If Not cell Like "*-*" And LCase(Left(cell, 5)) <> "total" And Not IsDate(cell) And cell <> "" Then
Rows(r).Delete
End If
Next r
End Sub
Bookmarks