'---restitution---
With Feuil2
If n Then
If .FilterMode Then .ShowAllData 'si la feuille est filtrée
With .Cells(.Rows.Count, 1).End(xlUp)(2)
.Resize(n, 3) = t
.Cells(1, 4).NumberFormat = "dd/mm/yyyy"
.Cells(1, 4) = Sheets("initial").[B3]
.Cells(1, 5) = Sheets("initial").[B2]
End With
End If
.Columns(2).Resize(, 4).AutoFit 'ajustement largeur
.Activate 'facultatif
End With
NomCDP = Sheets("initial").[B2]
DateCDP = Sheets("initial").[B3]
proces = t(3, j)
For i = 4 To nlig
If t(i, j) <> "" Then
n = n + 1
ReDim Preserve resu(1 To 5, 1 To n)
resu(1, n) = proces
resu(2, n) = t(i, 1)
resu(3, n) = t(i, ncol)
resu(4, n) = NomCDP
resu(5, n) = DateCDP
End If
Next
End If
Next
'---transposition---
ReDim t(1 To n, 1 To 5) '3
For i = 1 To n
t(i, 1) = resu(1, i)
t(i, 2) = resu(2, i)
t(i, 3) = resu(3, i)
t(i, 4) = NomCDP
t(i, 5) = DateCDP