Overflow Error in Future Value Calcuation

needshelp12

New Member
Joined
Jun 24, 2011
Messages
14
I am getting a Overflow error with my code :

Sub FutureValue1_Click()

Dim Value As Long
Dim Rate As Double
Dim NumPayment As Double
Dim Payment As Double
Dim Presentvalue As Double


Rate = Rate1.Text
NumPayment = NumPayment1.Text
Payment = Payment1.Text
Presentvalue = Presentvalue1.Text

Value = fv(Rate, NumPayment, Payment, Presentvalue)

FutureV.Text = Value

End Sub

Can anyone figure out why i am getting this error , thanks !!
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Firstly, you should not use "value" as a variable name as it's already a key word in VBA (refers to the property of an object)

Secondly, you are then trying to apply a spreadsheet defined function within VBA code without telling the code that is what you are doing.

I think this is what you want:
Code:
Sub FutureValue1_Click()

Dim myValue As Long
Dim Rate As Double
Dim NumPayment As Double
Dim Payment As Double
Dim Presentvalue As Double

Rate = Rate1.Text
NumPayment = NumPayment1.Text
Payment = Payment1.Text
Presentvalue = Presentvalue1.Text

myValue = Application.fv(Rate, NumPayment, Payment, Presentvalue)

FutureV.Text = myValue

End Sub
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,728
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top