1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
Sub Test()
Dim FL1 As Worksheet
Dim Valeur As Variant, c As Range, Valeur2 As Variant, d As Range
Dim NoLigne As Long, DerLig As Long, NoLigne2 As Long, DerLig2 As Long
Set FL1 = Worksheets("BlaBla")
NoLigne = 1
Do
If Not Cells(NoLigne, 1) = "" Then
Valeur = Cells(NoLigne, 2)
Valeur2 = Cells(NoLigne, 1)
Do
With FL1.Range("B" & NoLigne + 1, [B65536].End(xlUp))
DerLig = 0
Set c = .Find(Valeur, LookIn:=xlValues, LookAt:=xlWhole)
If Not c Is Nothing Then
If c.Row > NoLigne Then
With FL1.Range("A" & NoLigne + 1, [A65536].End(xlUp))
Set d = .Find(Valeur2, LookIn:=xlValues, LookAt:=xlWhole)
If Not d Is Nothing Then
DerLig = c.Row
c.EntireRow.Delete
End If
End With
End If
End If
Set c = Nothing
End With
Loop While DerLig > NoLigne
End If
NoLigne = NoLigne + 1
Loop While NoLigne < FL1.Range("B65536").End(xlUp).Row
End Sub |
Partager