VBA 行列の収納(関数)
Function Matrix(ByVal k As Integer, ByVal l As Integer, ByVal m As Integer, ByVal n As Integer) As Double()
Dim i As Integer
Dim j As Integer
Dim Arr() As Double
ReDim Arr(1 To m, 1 To n)
For i = 1 To m
For j = 1 To n
Arr(i, j) = Cells(k - 1 + i, l - 1 + j).Value
Next j
Next i
Matrix = Arr
End Function