1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
Option Explicit
Option Compare Text
Sub supprimeLignes_Conditionnel()
Dim x As Integer, y As Integer, Resultat As Integer
Dim Plage As Range
Dim leNom As String
x = Sheets("Feuil1").Range("A65536").End(xlUp).Row
Set Plage = Sheets("Feuil2").Range("A1:A" & _
Sheets("Feuil2").Range("A65536").End(xlUp).Row)
For y = x To 1 Step -1
Resultat = 0
leNom = Sheets("Feuil1").Cells(y, 1)
On Error Resume Next
Resultat = Application.Match(leNom, Plage, 0)
If Resultat = 0 Then Sheets("Feuil1").Rows(y).Delete
Next y
End Sub |
Partager