I have the following problem:
- I have a file where I calculate a cash flow depending of several parameters and I want to construct a sensitivity matrix.
- I have written a code where I copy each the first column value to the Cash Flow Model Assumptions.
- Then I go back to the matrix and copy the first row value to the Assumptions sheet
- then I go to the Cash Flow sheet and Hlookup the value of the row I pasted on the step before and i want to print this into the matrix first column and loop through all of the columns and all of the rows.
The problem is that I manage to obtain the tir values i looked up but i can't print them into the matrix.
Heres a sample of the code:
![]()
Sub IrrMatrix1() Dim cap As Range Dim hold As Range Dim i As Integer i = 1 For Each cap In Range("d9:h9") cap.Copy Sheets("Supuestos").Select Range("I24").Select Selection.PasteSpecial Paste:=xlValues Sheets("Sensitivities").Select For Each hold In Range("c10:c13") hold.Copy Sheets("Supuestos").Select Range("I23").Select Selection.PasteSpecial Paste:=xlValues Sheets("CF").Select tir = Application.WorksheetFunction.HLookup(hold, Range("$G$9:$X$75"), 66, False) tir = hold.Offset(0, i) Sheets("Sensitivities").Select Next hold Next cap i = i + 1 End Sub
Bookmarks