Hi! I am trying to complete a portfolio analysis in excel. We are doing this in a finance class and I am using VBA to make it easier and faster with calculations. I am left with a covariance matrix which needs to vary by size. I have tried to start where I calculate the first stock with the rest(vertical). But I am not sure why the code won`t work:
Expl:Please Login or Register to view this content.
wb.hs.Cells(i + 1, 2) starts with row 2 and column 2(will turn into variable later).
wb.ws.Range([Cells(1, 1), Cells(h, 1)]) is first stock
wb.ws.Range([Cells(1, i), Cells(h, i)]) is first stock and increases by 1 stock range each time i increases.
I appreciate any help. Thank you.
Bookmarks