Download Inscribe User's Guide

Transcript
The following procedure uses a dynamic array, varray, to hold cash flow values the user
enters:
Sub main
Dim aprate as Single
Dim cflowper as Integer
Dim msgtext
Dim x as Integer
Dim netpv as Double
cflowper=InputBox("Enter number of cash flow periods")
For x= 1 to cflowper
varray(x)=InputBox("Enter cash flow amount for &
period #" & x & ":")
Next x
aprate=InputBox("Enter discount rate: ")
If aprate>1 then
aprate=aprate/100
End If
netpv=NPV(aprate,varray())
msgtext="The net present value is: "
msgtext=msgtext & Format(netpv, "Currency")
MsgBox msgtext
End Sub
Inscribe User’s Guide
26
Language Overview