VBA Excel matrix addition

You need to add up the matrices using VBA Excel. For multiplication, there is a function of the MMult sheet, for addition, I did not find such a function. You can add it element-by-element through For loops, but for large matrices in iteration algorithms, such addition without a built-in library will slow down calculations very much. On the addition of a matrix of type C=A+B, the interpreter swears-incompatible types.

Author: McConst, 2020-11-01

1 answers

Why is it piecemeal?

Https://www.youtube.com/watch?v=TAElTGKlvTM

If you want a macro, do the same as in the video:

Sub Main()
Dim ArrayA As Variant
Dim ArrayB As Variant
Dim ArrayC As Variant
With Range("d6:f8")
 ArrayA = .Value
 ArrayB = .Offset(5,).Value
 ArrayC = .Parent.Evaluate(.Address & "+" & .Offset(5,).Address)
End With
End Sub
 0
Author: DiD, 2020-11-01 17:48:15