Friday
November 21, 2014

Homework Help: VBA programming

Posted by Matt on Friday, June 28, 2013 at 1:19am.

How to get isnumeric function to display an "error" message when necessary.

Sub DetermineinterestSelectCase()
Dim loan As Variant
Dim interest As Double
loan = InputBox("Enter your desired loan amount, from 1 dollar to 5 million dollars.")
Select Case loan
Case IsNumeric(loan) = False: MsgBox ("Error")
Case Is < 1000000: interest = ".08"
Case 1000000 To 4000000: interest = ".10"
Case Is > 4000000: interest = ".11"
End Select
MsgBox ("The loan amount was " & loan & " with an interest rate of " & interest & "")
End Sub

Sub DetermineinterestIf()
Dim loan As Variant
Dim interest As Double
loan = InputBox("Enter your desired loan amount, from 1 dollar to 5 million dollars.")
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

Answer this Question

First Name:
School Subject:
Answer:

Related Questions

VBA Programming - I'm trying to create a macro that asks for a loan between 1 ...
Computer Programming - I'm trying to create a vba code that solves this problem...
Vba - I'm trying to write a sub that asks how much oil I made, and then gives me...
math - Loan #1 Year Amount owed 1 $3796 2 $3942 3 $4088 Loan # 2 Year Amount ...
VBScript - Option Explicit Dim Answer Dim aScores() Dim intNumScores ' ...
math - Loan #1 Year Amount owed 1 $3796 2 $3942 3 $4088 Loan # 2 Year Amount ...
eco - Suppose a person pays $80 of annual interest on a loan that has a 5 ...
programming - write a program to calculate the amount of a server's tip given ...
Math - What is the amount of interest on the loan? $ b. What is the maturity ...
Computer science - Write an HTML form that prompts the user to enter loan amount...

Search
Members