how to operate on double-zeroed-indexed array?
I.e.
sub script ‘VBA code line
Dim s(), r() ‘VBA code line
s=[{1,2;3,4;5,6}] ‘VBA code line
r=sum(application.index(s,0,0), [{7,7;7,7;7,7}]) ‘failed VBA code line
r is equal to the sum of array s and a numerical array, both of size 3 rows by 2 columns, where the latter numerical input array has elements of 7s.
r should be equal to this array {[8,9;10,11;12,13]}
What needs to be corrected to make this method work?
I have tried worksheet(“sheet1”) before application, and it did not make a difference.
I know of looping, but I want to try for vectorized answer. My background is in MATLAB where vectorizations can be faster than looping. While this may not be true in Excel, I want to pursue vectorization as also the scale of problems of interest are small.
Sum Up Same-Sized Arrays
Usage
The Function
PrintData Result
PrintDataprocedure here.