Private Sub Worksheet_Activate()
Dim tablo, resu(), i&, n&
With Feuil1.[A1].CurrentRegion.Resize(, 19) 'Feuil1 : CodeName
tablo = .Value 'matrice, plus rapide
ReDim resu(1 To UBound(tablo), 1 To 6)
For i = 2 To UBound(tablo)
If .Cells(i, 1).Interior.ColorIndex <> 3 And tablo(i, 8) <> "" Then
n = n + 1
resu(n, 1) = tablo(i, 5)
resu(n, 2) = tablo(i, 1)
resu(n, 3) = tablo(i, 2)
resu(n, 4) = tablo(i, 3)
resu(n, 5) = tablo(i, 4)
resu(n, 6) = tablo(i, 19)
End If
Next
End With
'---restitution---
With [A2] '1ère cellule de restitution, à adapter
If n Then .Resize(n, 6) = resu
.Offset(n).Resize(Rows.Count - n - .Row + 1).EntireRow.Delete 'RAZ en desous
.EntireColumn.Resize(, 6).AutoFit 'ajustement largeurs
End With
With UsedRange: End With 'actualise la barre de défilement verticale
End Sub