JaydeepBijlani
New Member
- Joined
- Aug 2, 2018
- Messages
- 2
Hello I am trying below VB code to execute PMT formula to calculate EMI but getting error "Unable to get pmt property of the worksheetFunction class"
Sub EMI()
Dim Loan_Amount As Double
Dim EMI As Double
Dim Rate As Double
Dim Payment_Per_Year As Double
Dim Tenure As Double
monthly_rate = Cells(7, 4).Value / Cells(8, 4).Value
Loan_Amount = Cells(5, 4).Value
Payment_Per_Year = Cells(8, 4).Value
number_of_periods = Cells(6, 4).Value * Cells(8, 4).Value
EMI = Application.WorksheetFunction.PMT(monthly_rate / 100, number_of_periods, Loan_Amount)
Range("D9").Value = EMI
End Sub
Please let me know if i am making any mistake
Sub EMI()
Dim Loan_Amount As Double
Dim EMI As Double
Dim Rate As Double
Dim Payment_Per_Year As Double
Dim Tenure As Double
monthly_rate = Cells(7, 4).Value / Cells(8, 4).Value
Loan_Amount = Cells(5, 4).Value
Payment_Per_Year = Cells(8, 4).Value
number_of_periods = Cells(6, 4).Value * Cells(8, 4).Value
EMI = Application.WorksheetFunction.PMT(monthly_rate / 100, number_of_periods, Loan_Amount)
Range("D9").Value = EMI
End Sub
Please let me know if i am making any mistake