Bonjour,
Voici une macro qui marque les lignes complémentaires. Ce qui permet de vérifier le résultat.
Après YAPUKA supprimer les lignes marquées...
Sub Galopin()
Dim i%, j%, k, Y As Boolean, x
k = Range("B1").End(4).Row
For i = 2 To k - 1
Y = False
If Cells(i, 3) = 0 Then
For j = i + 1 To k
If Cells(i, 2) + Cells(j, 2) = 0 Then
Cells(i, 3) = x + 1
Cells(j, 3) = x + 1
x = x + 1
Y = True
End If
If Y Then Exit For
Next j
End If
Next i
End Sub
Cet autre macro fait directement la suppression
Sub Galopin2()
Dim i%, j%, k, Y As Boolean, x
k = Range("B1").End(4).Row
For i = 2 To k - 1
Y = False
If Cells(i, 3) = 0 Then
For j = i + 1 To k
If Cells(i, 2) + Cells(j, 2) = 0 Then
Cells(i, 3) = x + 1
Cells(j, 3) = x + 1
x = x + 1
Y = True
End If
If Y Then Exit For
Next j
End If
Next i
For i = k To 2 Step -1
If Cells(i, 3) > 0 Then Rows(i).Delete
Next
End Sub
A+