Bonjour,
Voir ci-dessous
Cordialement
Sub Macro1()
Dim i As Long
Dim fin As Long
Dim aa As Variant
Dim bb As Variant
Dim y As Long
Dim a As Long
With Worksheets(1)
fin = .Range("A" & Rows.Count).End(xlUp).Row
aa = .Range("A2:W" & fin)
End With
y = 1
ReDim bb(UBound(aa, 2), y)
For i = 1 To UBound(aa) - 1
If aa(i + 1, 22) = 1 Then
ReDim Preserve bb(UBound(aa, 2), y)
For a = 1 To UBound(aa, 2) - 3
bb(a, y) = aa(i, a)
Next a
y = y + 1
End If
Next i
Worksheets(2).Select
Range("A1").Resize(UBound(bb, 2), UBound(bb)) = Application.Transpose(bb)
End Sub