Hi All,
I'm trying to build a really simple form that calculates the monthly payment of an investment.
so there are three textboxes:
1. Investment amount
2. Cost of capital
3. Amortization months.
and then I have a button that calculates the monthly payment using a PMT function.
The issue is that in the textbox of 'Cost of capital', if I put 5% for example it doesn't work! It gives me an error of 'Type mismatch'. If I put 0.05 then there's no problem and everything works.
Does anyone know how I can make it work with %? I've tried everything I could think of..
This is the code:
Payoff = Application.WorksheetFunction.Pmt(TxtCapital / 12, TxtAmort, -TxtHW)
Thanks!
I'm trying to build a really simple form that calculates the monthly payment of an investment.
so there are three textboxes:
1. Investment amount
2. Cost of capital
3. Amortization months.
and then I have a button that calculates the monthly payment using a PMT function.
The issue is that in the textbox of 'Cost of capital', if I put 5% for example it doesn't work! It gives me an error of 'Type mismatch'. If I put 0.05 then there's no problem and everything works.
Does anyone know how I can make it work with %? I've tried everything I could think of..
This is the code:
Payoff = Application.WorksheetFunction.Pmt(TxtCapital / 12, TxtAmort, -TxtHW)
Thanks!