Here is one primitve way of doing this
Sub DeleteRows()
lmax = ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell) .Row
For i1 = 1 To lmax
If (Cells(i1, 1).Value <> 2 And Cells(i1, 1).Value <> 4 And Cells(i1, 1).Value <> 5 And Cells(i1, 1).Value <> 7) Then
ActiveSheet.Rows(i1).EntireRow.Delete
i1 = i1 - 1
lmax = lmax - 1
If i1 >= lmax Then Exit Sub
End If
Next i1
End Sub
I have assumed that ur values will be in first column
Cheers
Shasur
http://www.vbadud.blogspot.com