更新 : 2007 年 11 月
Financial モジュールに含まれるプロシージャを使って、財務関連の操作を実行します。
解説
このモジュールは減価償却費、現在価値および将来価値、利率、収益率、および支払額などの財務計算を実行する Visual Basic ランタイム ライブラリ メンバをサポートします。
メンバ
|
|
|
使用例
次の例は、Rate 関数を使って、実際の利率を計算します。支払い回数 (TotPmts)、支払い額 (Payment)、現在価値または元金 (PVal)、将来価値 (FVal)、支払い期日 (PayType)、利率の推定値 (Guess) を指定します。
Sub TestRate()
Dim PVal, Payment, TotPmts, APR As Double
Dim PayType As DueDate
' Define percentage format.
Dim Fmt As String = "##0.00"
Dim Response As MsgBoxResult
' Usually 0 for a loan.
Dim FVal As Double = 0
' Guess of 10 percent.
Dim Guess As Double = 0.1
PVal = CDbl(InputBox("How much did you borrow?"))
Payment = CDbl(InputBox("What's your monthly payment?"))
TotPmts = CDbl(InputBox("How many monthly payments do you have to make?"))
Response = MsgBox("Do you make payments at the end of the month?", MsgBoxStyle.YesNo)
If Response = MsgBoxResult.No Then
PayType = DueDate.BegOfPeriod
Else
PayType = DueDate.EndOfPeriod
End If
APR = (Rate(TotPmts, -Payment, PVal, FVal, PayType, Guess) * 12) * 100
MsgBox("Your interest rate is " & Format(CInt(APR), Fmt) & " percent.")
End Sub