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
| Sub suppession_doublons()
Dim plage, plagebis As Range
Dim derlig, derlg As Long
Dim lavaleur As Variant
Dim rg As Range
derlig = Range("A" & Rows.Count).End(xlUp).Row
Set plage = Range(Cells(1, 1), Cells(derlig, 5))
tableau = plage.Value
For i = 1 To derlig
For j = 2 To 5
For Each sh In Worksheets(Array("EXP-DIF", "AAR", "RST"))
If tableau(i, 3) = 1 Then
If tableau(i, 2) = 1 Or tableau(i, 4) = 1 Then
lavaleur = tableau(i, 1)
If tableau(1, j) = sh.Name Then
sh.Select
derlg = Range("A" & Rows.Count).End(xlUp).Row
Set plagebis = Range(Cells(1, 1), Cells(derlig, 6))
tableaubis = plagebis.Value
For k = 1 To derligne
If tableaubis(i, 1) = lavaleur Then
tableaubis(i, 1).Select
Selection.EntireRow.Delete
End If
Next k
End If
End If
End If
Next sh
Next j
Next i
End Sub |
Partager