The syntax of the PV function is

PV(Rate,Nper, Pmt,FV,Due)Rate=Interest rate

Nper=The length of period (Usually number of years)

Pmt=Periodic payment

FV=Future Value

*Due= 1 if payment due at beginning of a period and Due=0 if payment due at the end of a period.

### The Interface

**The Code**

In our example, we are considering one single initial investment in order to earn a certain amount of money in the future, so Pmt is set to 0, and payment due is at the beginning of the period, so it is set at 0, the rest of the values are obtained from the users.

Private Sub cmdCal_Click()

Dim F_Money, Int_Rate, Investment As Double

Dim numYear As Single

F_Money = Val(Txt_FV.Text)

Int_Rate = (Val(Txt_Rate.Text) / 100)

numYear = Val(Txt_Year.Text)

Investment = PV(Int_Rate, numYear, 0, F_Money, 1)

Lbl_PV.Caption = Format(-Investment, "$##,###,##0.00")

End Sub

### [Back to Sample VB Programs]

*Copyright ® 2008** *Dr.Liew Voon Kiong** . **All rights reserved |

*Contact:*admin@vbtutor.net