For this part, we’ve chosen an academic problem that assigns grades to the students according to their score, then calculates the total and the average score for the whole class.
You are tasked with building VBA code to solve some sort of Excel problem that plagues you. This can be an academic problem or a work-related problem. On some level, it should be related to accounting, finance, or business.
At a minimum, your code must incorporate:
Bonus points for more complexity.
You have to show me how your code works and then walk us through the code that you have written. It will be helpful to add comments throughout your code.
1.1. Data description
Our data has the following columns:
1. Students: A string to describe the student.
2. Mark: an integer between 0 and 100.
3. Grade: a string that has the student grade that will be filled by the VBA program. As the following:
|B||>=85 and 75>|
|C||>=75 and 65>|
|D||>=65 and 50>=|
4. The total row: an integer that represents the sum of the students’ scores.
5. The avg row: a double that represents the average of all the student scores.
1.2. Data example
The data has been consistently filled up. An example is given below:
1. VBA code review
In this part, we’ll present the code and explain each line and we will present how we have used the following:
● and logic.
The explanation is shown in the table below: