Question
AverageTop10 macro: ? This macro calculates the average of the top 10 quizzes for each student. One way to do it is to utilitize Excels
AverageTop10 macro:
? This macro calculates the average of the top 10 quizzes for each student. One way to do it is to utilitize Excels large function. See the class discussion for more. Good as well to learn more. ? The macro should also produce the column header. The header should be left justified.
? All numbers should have two decimal places. If a number has zero or one digit after the decimal point, pad the number with additional zero(s) so that it has two digits after the decimal points. (Hint: use the NumberFormat property from the RANGE object. )
? Your macro should still work if the data is expanded. (In other words, dont hard-code the data range.)
? If you would like a template, you might want to start with the following:
32 Sub AverageTop10 ) Dim rng As Range Dim dataRow As Range Dim sum As Long Set rng= Cells (1, 1)CurrentRegion 3 4 35 36 37 38 39 40 41 42 43 ' x** Create the header '***Replace XXXxXxxxxx with a valid value so that ' ***the loop iterates enough times for the data For Row 2 To Set dataRowIdentify the current row of data (e.g, B2:N2) 45 4 6 47 4 8 4 9 50 51 52 sum 0 ' Create another loop to sum up each cell in the dataRow **After the above loop, show the data back to column P. Next Sub EndStep 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