How to set Textbox value = to a Percent ?

needshelp12

New Member
Joined
Jun 24, 2011
Messages
14
I am calculating various financial formulas, using UserForms in Excel 2010

I am declaring all values as doubles , which does not pose a problem for formulas like :

= nper( rate , Pmt, pv , fv)

Yet when it requires a percent like :

= pv( rate, nper, pmt, fv)

it only works if its in this format

= pv((6.5/12)%, nper, pmt, fv)


Here's my code:

Dim Value As String
Dim rate As Double
Dim nper As Double
Dim Fv As Double
Dim Pv As Double

rate = Rate1.Text
nper = NumPeriod1.Text
Pv = Pv1.Text
Fv = Fv1.Text

Value = Pmt(rate, nper, Pv, Fv)


Value = Format(Value, "Currency")
Payment1.Text = Value


Thanks !
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
I am assuming the input is typed as 6.5 thus the functions interpret that as 650% and not 6.5%. To fix that change the rate definition to.
rate = Rate1.Text / 100​
I am guessing though because you were not specific about what exactly was being returned (Error, Incorrect value, etc).
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

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