accessing individual array elements in VBA function
问题 VBA newbie here. I am trying to pass an array ( it is static, but please answer for dynamic range as well ) to a function. Then assign individual array elements to unique variables and use these variables in a custom formula. I just browsed around and wrote the code but keep getting #VALUE! error. The gist of the code is below: Public Function mytest(ByRef arr1 As Range) Dim A As Double Dim B As Double A = arr1(0) B = arr1(1) mytest = A + B 'The actual formula is a bit more complicated than