Hi everyone,

I'm trying to go through 685 rows of data and deleting any that don't have specific numbers in column A. I've never used macros before but through lots of Googling and experimenting I've come up with this macro:

Sub Delete_Rows2()
Dim cell As Range
Dim J As Integer
J = 685

For i = 2 To 685


Range(Cells(2, 1), Cells(J, 1)).Select
For Each cell In Selection
If cell <> "030247" _
And cell <> "030248:030258" _
And cell <> "030346" _
And cell <> "030347" _
And cell <> "030348" _
And cell <> "030353" _
And cell <> "030354" _
And cell <> "030357" _
And cell <> "030358" _
And cell <> "030359" _
And cell <> "030360" _
And cell <> "030627" _
And cell <> "030632" _
And cell <> "030644" _
And cell <> "030856" Then
cell.EntireRow.Select
Selection.Delete

J = J - 1
End If
Next cell

Next i

End Sub


This does exactly what I need, however I need about 100 "And" statements and Excel won't let me add many more. Is there other syntax that I could use to allow more options or do I have to break this into multiple macros/sets of if/and statements?

Thanks!