On Sheet1 I have defined a named range called XValues consisting of cells A2 through to A11. I am trying to pass the values of the named range to a 1-dimensional array in VBA in order to do a calculation on them.
The code below is giving me a "subscript out of range" error on the line that puts the calculation results in column E. I watched the expression MyXArray, and the values from the named range do end up in the array, however, a second dimension is added. The value in cell A3 ends up in MyXArray(2,1) for example, where I assumed it would end up in MyXArray(2).
Why? What am I doing wrong?? Why does Excel turn the 1D array into a 2D array..?
Bookmarks