I'm trying to create a loop to conduct a goal seek to help determine debt payments. Essentially I'm trying to determine the amount of principal payment given the available cash to maintain a minimum level of Debt Service coverage ratio as well the tenor of the loan.
i have written the following code to help me with that but i'm getting stuck even before going into the loop. The error is "Select method of Range class failed"
I have copied this from another file and the macro seems to work just fine in that file.
Helpful thoughts would be greatly appreciated.
Thanks
Sub Macro_DD()
'
' Macro_DD Macro
' Macro for: debt repayment schedule to match the 17 year debt tenor at all times.
'
'
Application.ScreenUpdating = False
Sheets("Debt Schedule").Range("PDebt").ClearContents
Sheets("Assumptions").Range("DSCR").Select
ActiveCell.FormulaR1C1 = "1.3"
Do While Check_Debt <> "OK"
Sheets("Assumptions").Range("OPeriods").GoalSeek Goal:=Range("IPeriods"), ChangingCell:=Sheets("Assumptions").Range("DSCR")
Sheets("Debt Schedule").Range("CDebt").Copy
Sheets("Debt Schedule").Range("PDebt").PasteSpecial xlPasteValues
Sheets("Debt Schedule").Range("CDebt").Copy
Sheets("Debt Schedule").Range("PDebt").PasteSpecial xlPasteValues
Sheets("Debt Schedule").Range("CDebt").Copy
Sheets("Debt Schedule").Range("PDebt").PasteSpecial xlPasteValues
Sheets("Debt Schedule").Range("CTotalDebt").GoalSeek Goal:=Range("PTotalDebt"), ChangingCell:=Sheets("Assumptions").Range("DSCR")
Sheets("Debt Schedule").Range("CDebt").Copy
Sheets("Debt Schedule").Range("PDebt").PasteSpecial xlPasteValues
Sheets("Debt Schedule").Range("CDebt").Copy
Sheets("Debt Schedule").Range("PDebt").PasteSpecial xlPasteValues
Sheets("Debt Schedule").Range("CDebt").Copy
Sheets("Debt Schedule").Range("PDebt").PasteSpecial xlPasteValues
Check_Debt = Range("Check_Debt")
Loop
Application.CutCopyMode = False
Sheets("Assumptions").Select
Application.ScreenUpdating = True
End Sub
Bookmarks