Suppression si plusieurs conditions

Bonjour à tous,

Je cherche à supprimer une ligne si la condition est rempli en dans un colonne (Q).

Voici le code utilisé

17 étant la colonne Q du fichier

Dim i As Long

Application.ScreenUpdating = False

For i = Range("G65536").End(xlUp).Row To 1 Step -1

If Cells(i, 17).Value = "TEST1" Or "TEST2" Then Rows(i).Delete

Next i

Application.ScreenUpdating = True

End Sub

Merci de votre aide

Je me réponds ..... c'était un oublie de ma part.....

Dim i As Long

Application.ScreenUpdating = False

For i = Range("G65536").End(xlUp).Row To 1 Step -1

If Cells(i, 17).Value = "TEST1" Or Cells(i, 17).Value= "TEST2" Then Rows(i).Delete

Next i

Par contre ce que je ne comprends pas j'essaye d'inverser la conditions

A savoir supprimer toutes les lignes autres que TEST1 ou TEST2

Mais ca ne marche pas lorsque je change l'opérateur de conditions

If Cells(i, 17).Value <> "TEST1" Or Cells(i, 17).Value<> "TEST2" Then Rows(i).Delete

Next i

Bonjour

Essayes avec AND

Dim i As Long

Application.ScreenUpdating = False
For i = Range("G65536").End(xlUp).Row To 1 Step -1
If Cells(i, 17).Value <> "TEST1" And Cells(i, 17).Value<> "TEST2" Then Rows(i).Delete
Next i
Rechercher des sujets similaires à "suppression conditions"