Private Sub Worksheet_Activate()
Dim ncol%, nlig&, tablo, resu(), j%, i&, n&
With Sheets("Data").UsedRange
ncol = 10 + Application.CountIf(.Rows(1), "Client*")
nlig = .Rows.Count
tablo = .Resize(, ncol)
End With
ReDim resu(1 To Rows.Count, 1 To 8)
For j = 11 To ncol
For i = 2 To nlig
If tablo(i, j) > 0 Then
n = n + 1
resu(n, 1) = tablo(i, 1) 'date
resu(n, 2) = tablo(i, 4)
resu(n, 3) = tablo(i, 7)
resu(n, 4) = tablo(i, 2)
resu(n, 5) = tablo(i, 8)
resu(n, 6) = "=TEXT(RC[-2],""000"")"
resu(n, 7) = Mid(tablo(1, j), 8, 3) 'client
resu(n, 8) = tablo(i, j) 'Qté copiée
End If
Next i, j
'---restitution---
If FilterMode Then ShowAllData 'si la feuille est filtrée
With [A2] '1ère cellule de restitution, à adapter
If n Then .Resize(n, 8) = resu
.Offset(n).Resize(Rows.Count - n - .Row + 1, 8).ClearContents 'RAZ en dessous
End With
End Sub