Tuesday
July 29, 2014

Homework Help: VBA Programming

Posted by Matt on Friday, June 28, 2013 at 4:13pm.

I'm trying to create a macro that asks for a loan between 1 dollar and 5 million, and returns different interest rates based on the amount of the loan. For some reason when I type in different loan amounts it automatically makes my rate ".1", when it should be say ".08", or ".11" because of the entered loan amount.
Heres my code so far:

Sub DetermineinterestIf()
Dim loan As Variant
Dim interest As Double
Do
loan = InputBox("Enter your desired loan amount, from 1 dollar to 5 million dollars.")
Loop Until IsNumeric(loan)
If loan < 1000000 Then interest = ".08"
If loan > 4000000 Then interest = ".11"
If 1000000 < loan < 4000000 Then interest = ".10"
MsgBox ("The loan amount was " & loan & " with an interest rate of " & interest & ".")
End Sub

Any ideas where I have gone wrong?

Answer this Question

First Name:
School Subject:
Answer:

Related Questions

VBA programming - How to get isnumeric function to display an "error" message ...
math - Suppose that you took out a loan at 7% interest for 192 days. If the ...
n nb - The annual interest rate for a customerís loan of $425 is 15.75%. What is...
math - The annual interest rate for a customerís loan of $425 is 15.75%. What is...
math - The annual interest rate for a customerís loan of $425 is 15.75%. What is...
accounting - The annual interest rate for a customerís loan of $425 is 15.75%. ...
Accounting - The annual interest rate for a customerís loan of $675 is 19.25%. ...
Math - The annual interest rate for a customerís loan of $425 is 15.75%. What is...
Business Math - Find the amount of the principal on a loan at 6% interest for ...
math - step by step on how to calculate the annual payment on a loan with a ...

Search
Members