Hi

I am trying to calculate the variance-covariance from a matrix containing historical stock info.

Please Login or Register  to view this content.
The different columns in the StockMatrix represent the various stocks, and the rows the historical data. I however cannot figure out how to call a whole column from the StockMatrix. Above I have tried with rs:re (abbr. for row_start:row_end). I have tried to google a solution, and it seems a lot of people use the WorksheetFunction Index, but I have a hard time understanding the use of Index in VBA--why not refer to array elements by just using their indices directly, why would you want to write the extra word Index?

I have been basing my code on some code I found on the internet:

Please Login or Register  to view this content.
Where dArrData is the same as my Stockmatrix. So here it seems that a whole column is called by just using "0", but in my mind Index(dArrData, 0, j) simply refers to the element(singular) located at (0 , j)--and once again, why use the Index function, why not just go dArrData(0,j)?

Thanks for any help :-)