Bonsoir,
Il y a sans doute plus simple.
Option Explicit
Public Matrice() As Variant
Sub TestGenererMatrice()
GenererMatrice Range("B9:B11"), Range("F9")
End Sub
Sub GenererMatrice(ByVal AireColonne As Range, ByVal CelluleDestination As Range)
Dim I As Integer, J As Integer
ReDim Matrice(AireColonne.Count - 1, AireColonne.Count - 1)
For I = LBound(Matrice, 2) To UBound(Matrice, 2)
For J = LBound(Matrice, 1) To UBound(Matrice, 1)
Matrice(J, I) = 0
Next J
Next I
J = 1
For I = LBound(Matrice, 2) To UBound(Matrice, 2)
Matrice(J - 1, I) = AireColonne(J)
J = J + 1
Next I
For I = LBound(Matrice, 2) To UBound(Matrice, 2)
For J = LBound(Matrice, 2) To UBound(Matrice, 2)
With CelluleDestination
.Offset(J, I) = Matrice(J, I)
End With
Next J
Next I
End Sub