April 18, 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
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:

Related Questions

Computer Programming - A babysitter takes care of 20 kids. When taking care of ...
Computer Programming - I'm trying to create a vba code that solves this problem...
Computer Information - A __________ provides the tools that a programmer uses to...
Computer science - THIS IS C PROGRAMMING I NEED TO CREATE A METHOD! Create a ...
programming - create a program that prompts the user for a number the returns ...
Macro econ - How might a “perfect” macro equilibrium be affected by (a) a stock ...
Programming (CSI Programming Logic and Design) - Create a program that outputs a...
Programming (CSI 150 Programming Logic and Design) - Create a program that ...
Vba - I'm trying to write a sub that asks how much oil I made, and then gives me...
programming - write a program that asks the user to enter an objects mass, and ...