g INTRODUCTION
The Present value is the value on a given date of a future payment or series of future payments (NPV), discounted to reflect the time value of money and other factors such as investment risk. Present value calculations are widely used in business and economics to provide a means to compare cash flows at different times on a meaningful "like to like" basis.
The formula is : C(t) = C(1+i)^(-t) = C / (1+i)^(t)
g ROUTINES
Firstly you declare all variable you are going to use during the execution of the routine [1]. The you wil define the amount of the capital of which you want to calculate the present value [2]. After that, you enter the interest rate [3]. In the next step you will have to enter the number of periods [4]. Then the routine will caculate the Present Value, and finaly display it on the screen, in the dialog box you have previously configurated, using the Userform option.
[1]------------------------------------------------------------------
Public Sub ValueCalculus()
Dim InpCap As Double
'Declare the variable InpCap which is the Capital
Dim InpInt As Double
Dim InpPer As Double
Dim Value As Double
[2]------------------------------------------------------------------
Msgb = "Do you want to enter the capital?"
Ans = MsgBox(Msgb, vbYesNo)
If Ans = vbNo Then
MsgBox "Think a little bit more!"
InpCap = Application.InputBox("How much is the capital")
Else
InpCap = Application.InputBox("How much is the capital")
End If
[3]------------------------------------------------------------------
Msgb = "Do you want to enter the interest rate?"
Ans = MsgBox(Msgb, vbYesNo)
If Ans = vbNo Then
MsgBox "Think a little bit more!"
InpInt = Application.InputBox("How much is the interest rate in %")
Else
InpInt = Application.InputBox("How much is the interest rate in %")
End If
[4]------------------------------------------------------------------
Msgb = "Do you want to enter the the number of periods"
Ans = MsgBox(Msgb, vbYesNo)
If Ans = vbNo Then
MsgBox "Think a little bit more!"
InpPer = Application.InputBox("For how many periods of time")
Else
InpPer = Application.InputBox("For how many periods of time")
End If
[5]------------------------------------------------------------------
Value = InpCap / ((1 + (InpInt / 100)) ^ InpPer)
MsgBox "The calculated value is " & Value
End Sub
------------------------------------------------------------------
g PICTURE 1
The Present value is the value on a given date of a future payment or series of future payments (NPV), discounted to reflect the time value of money and other factors such as investment risk. Present value calculations are widely used in business and economics to provide a means to compare cash flows at different times on a meaningful "like to like" basis.
The formula is : C(t) = C(1+i)^(-t) = C / (1+i)^(t)
g ROUTINES
Firstly you declare all variable you are going to use during the execution of the routine [1]. The you wil define the amount of the capital of which you want to calculate the present value [2]. After that, you enter the interest rate [3]. In the next step you will have to enter the number of periods [4]. Then the routine will caculate the Present Value, and finaly display it on the screen, in the dialog box you have previously configurated, using the Userform option.
[1]------------------------------------------------------------------
Public Sub ValueCalculus()
Dim InpCap As Double
'Declare the variable InpCap which is the Capital
Dim InpInt As Double
Dim InpPer As Double
Dim Value As Double
[2]------------------------------------------------------------------
Msgb = "Do you want to enter the capital?"
Ans = MsgBox(Msgb, vbYesNo)
If Ans = vbNo Then
MsgBox "Think a little bit more!"
InpCap = Application.InputBox("How much is the capital")
Else
InpCap = Application.InputBox("How much is the capital")
End If
[3]------------------------------------------------------------------
Msgb = "Do you want to enter the interest rate?"
Ans = MsgBox(Msgb, vbYesNo)
If Ans = vbNo Then
MsgBox "Think a little bit more!"
InpInt = Application.InputBox("How much is the interest rate in %")
Else
InpInt = Application.InputBox("How much is the interest rate in %")
End If
[4]------------------------------------------------------------------
Msgb = "Do you want to enter the the number of periods"
Ans = MsgBox(Msgb, vbYesNo)
If Ans = vbNo Then
MsgBox "Think a little bit more!"
InpPer = Application.InputBox("For how many periods of time")
Else
InpPer = Application.InputBox("For how many periods of time")
End If
[5]------------------------------------------------------------------
Value = InpCap / ((1 + (InpInt / 100)) ^ InpPer)
MsgBox "The calculated value is " & Value
End Sub
------------------------------------------------------------------
g PICTURE 1
No hay comentarios:
Publicar un comentario