Hello there!

What I want the code to do is quite simple: Go through each cell of a column and delete every row that is not equal to two variables. It should start at row 2 and stop at the first emtpy cell.

Now I have actually found an alternative to my code that works somewhere else but I would still like to know why mine won't work. It does work perfectly if I'm not using the "<>" operator but not using it isn't practical for my purposes. At the moment what it does is, it's deleting every 2nd row disregarding the content in the specified cell/column.
So here's the code:

Sub SearchAndDestroyRow()


Dim introw As Long
Dim level1 As Integer
Dim level2 As Integer
Dim intcol As Integer
level1 = 9
level2 = 15
introw = 2
intcol = 1
Cells(introw, intcol).Activate 



    Do Until IsEmpty(ActiveCell.Value)
        
            If (Cells(introw, intcol) <> level1 And Cells(introw, intcol) <> level2) Then Rows(introw).EntireRow.Delete

        introw = introw + 1
        Cells(introw, intcol).Activate
   Loop



End Sub
Thank you very much =)