I want to create a function in Excel VBA that can do matrices multiplication for multiple matrices (undefined numbers of augments). The following is my code (I use ParamArray in this function), but it returns an error. Could anyone help me debug it?
Function MultMMult(ParamArray X() As Variant)
Dim aMatrix As Variant
For aMatrix = LBound(X) To UBound(X)
MultMMult = Application.WorksheetFunction.MMult(MultMMult, X(aMatrix))
Next aMatrix
End Function
Function MultMMult(ParamArray X() As Variant)
Dim aMatrix As Variant
For aMatrix = LBound(X) To UBound(X)
MultMMult = Application.WorksheetFunction.MMult(MultMMult, X(aMatrix))
Next aMatrix
End Function