Question
How to Create another macro that checks to make sure that the user enters a number 1 through 4, and then use that number to
How to Create another macro that checks to make sure that the user enters a number 1 through 4, and then use that number to calculate Qavg. Give the user at least 5 chances to enter an appropriate quarter. Do not use Case or IF to determine which quarter to average. Use the variable in the input box either concatenated to something else, or as a designation of an array element. You can also consider named ranges.
You need a loop to give the user 5 chances to get a number between 1 and 4. Let the user know how many opportunities are left to get an acceptable number. If the 5th attempt does not provide a valid number, say goodbye and exit the subroutine.
Assign a variable to the input box, and use an IF statement to determine if the variable value is between 1 and 4. But that is the only If or Case allowed. You cannot use Case or IF to decide which quarter to average. If the number provided by the user is acceptable, incorporate it into code through concatenation and/or an array value.
The only IF (or Case) in your extra credit macro should determine if the input value is between 1 and 4. Get the proper average and message box without an additional IF.
Here are what I have right now. Please see the pictures
.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started