'formule " =matrice(A1:A15)"
Sub testmatrice()
X = Matrice([A1:A15].Value)
[F1].Resize(UBound(X)) = X
End Sub
Function Matrice(Source)
'Source est une plage de cellules ou une matrice en base 1
Dim nlig&, ncol%, tablo, i&, j%
Source = Source
If IsArray(Source) Then nlig = UBound(Source): ncol = UBound(Source, 2) Else nlig = 1: ncol = 1
On Error Resume Next
ReDim tablo(1 To Application.Caller.Rows.Count, 1 To ncol)
If Err.Number > 0 Then ReDim tablo(1 To nlig, 1 To ncol)
For i = 1 To UBound(tablo)
For j = 1 To ncol
If i > nlig Then tablo(i, j) = "" Else If IsArray(Source) Then tablo(i, j) = Source(i, j) Else tablo(1, 1) = Source
Next j, i
Matrice = tablo
End Function