Visual Basic code for retirement calculator?
You are currently browsing comments. If you would like to return to the full story, you can read the full entry here: “Visual Basic code for retirement calculator?”.
Filed under: Retirement Planning
Like this post? Subscribe to my RSS feed and get loads more!
I coded one that does that in addition to calculating mortgage payments.
I can’t send it on YA. It must be sent on your regular email.
EDIT
You can use the built-in function of VB to calculate the monthly amount you need to deposit for a length of time to accumulate a given amount (also a mortgage payment.
It is Pmt() using the following formula for your problem
Dim Rate as double = (5/100) / 12
Dim Duration as integer = 12*40
Dim PresentVal as double = 0
Dim FutureVal As Double= 457806.05
Dim MonthlyDeposit as double
MonthlyDeposit = -Pmt(Rate,Duration,PresentVal,FutureVal)
MsgBox(MonthlyDeposit)
TexMav