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
| Sub clearV4()
Dim rebalayer As Boolean, Dcel As Long, x As Long, y As Long, Tb, Dbl As Object, Result()
Dim a As Long
Set Dbl = CreateObject("Scripting.Dictionary")
With Sheets("test") 'choisir la bonne feuille
Dcel = .Range("Q" & .Rows.Count).End(xlUp).Row
Tb = .Range("A2", "AA" & Dcel)
For x = 1 To UBound(Tb)
Dbl(Tb(x, 17)) = ""
Next x
End With
ReDim Result(1 To Dbl.Count, 1 To UBound(Tb, 2))
y = 0
For x = 1 To UBound(Tb, 1) - 1
If Tb(x, 17) = Tb(x + 1, 17) And Tb(x, 10) Like "DZ*" Then
Else
y = y + 1
For a = 1 To UBound(Tb, 2)
Result(y, a) = Tb(x, a)
Next a
End If
Next x
'ci=dessous, attention de bien choisir la feuille de destination
Sheets("test").Range("A2", "AA" & Dcel).Clear
Sheets("test").Range("A2").Resize(UBound(Result, 1), UBound(Result, 2)) = Result
End Sub |
Partager