本文介绍了如何计算Financial.PMT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何计算多年来以一定利率投资的资金总额?
How do I calculate a sum of money invested at a certain interest rate for a number of years?
推荐答案
Sub TestPMT()
Dim PVal, APR, Payment, TotPmts As Double
Dim PayType As DueDate
Dim Response As MsgBoxResult
' Define money format.
Dim Fmt As String = "###,###,##0.00"
' Usually 0 for a loan.
Dim FVal As Double = 0
PVal = CDbl(InputBox("How much do you want to borrow?"))
APR = CDbl(InputBox("What is the annual percentage rate of your loan?"))
If APR > 1 Then APR = APR / 100 ' Ensure proper form.
TotPmts = CDbl(InputBox("How many monthly payments will you make?"))
Response = MsgBox("Do you make payments at the end of month?", MsgBoxStyle.YesNo)
If Response = MsgBoxResult.No Then
PayType = DueDate.BegOfPeriod
Else
PayType = DueDate.EndOfPeriod
End If
Payment = Pmt(APR / 12, TotPmts, -PVal, FVal, PayType)
MsgBox("Your payment will be " & Format(Payment, Fmt) & " per month.")
End Sub
并在这里看看:
http://msdn.microsoft.com/en-us/library/hyd90ysd%28v = vs.71%29.aspx [ ^ ]
and take a look here:
http://msdn.microsoft.com/en-us/library/hyd90ysd%28v=vs.71%29.aspx[^]
这篇关于如何计算Financial.PMT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!