Question: This is for VBA The user (me) will input two positive integers into cells C3 and C4 on Sheet1. Create a run button on Sheet1

This is for VBA

The user (me) will input two positive integers into cells C3 and C4 on Sheet1.

Create a run button on Sheet1 that executes a macro named problem1. This macro performs the following tasks:

Obtain the two integers A and B from cells C3 and C4 on Sheet1, then check is A is less than B. If A is greater than B, tell the user that A needs to be smaller than B via a message box then end the program.

Use a For loop to determine the sum of all even integers from A to B.

Use a For loop to determine the sum of all odd integers from A to B.

Use a For loop to determine the sum of all integers that are evenly divisible by 5 from A to 2*B

Output the smallest of the three sums to cell E6, the middle sum in cell E7, and the largest of the three sums to cell E8.

You may solve this problem by using as many For loops as you like, but do not use Do loops.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!