Friday
April 18, 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 ...
programming - 1.Write a query to display the names of the employees that do not ...
VBA EXCEL - I was wondering I have 3 input boxes and with one of them I need the...
Programming Logic - I need help creating a program to display the integers from ...
Programming Logic - I need help creating a program to display the integers from ...
Engineering:Digital Design - Information given: 1) 2 X 8-bits input A and B 2) ...
Programming - Write a program that would calculate and display the results for ...
social - Ok, I think both of these are syndicated but im so confused! The type ...
social - Ok, I think both of these are syndicated but im so confused! The type ...
Computer Programming - Hoe do I write a program to Create a C++ console ...

Search
Members