New to the forums, I'm taking a class on vba but learning quick and I've grown to enjoy it.. sorry my first post is a question!
My question states "grade for each student will be based on a weighted average of the students' scores for various work completed during the course. The professor records each work as a percentage and then computes the final grade by multiplying each work percentage times its corresponding weight and summing theses to obtain a final score. The course letter grade is then determined based on this final score. The weights for each work and the values necessary to convert the final grade to a letter grade are give"
I have..
My coding shows it needs to be debugged at the <= parts and I can't seem to figure it out
If more information is needed let me know and I will provide it.
Sub project_cal_Scorerankings()
Range("A3").Value = "Work Item"
Range("B3").Value = "Project 1"
Range("C3").Value = "Project 2"
Range("D3").Value = "Exam 1"
Range("E3").Value = "Exam 2"
Range("F3").Value = "Final Exam"
Range("F3").Value = "Final Score"
Range("A3:H3").Font.Bold = True
Range("A3:H3").Font.ColorIndex = 5
Range("A3:H3").Interior.ColorIndex = 6
Range("A3:H3").Columns.AutoFit
question = "y"
Do While question = "y"
erow = Sheet1.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
question = Application.InputBox("Do you wish to enter data? Type 'n' to end or 'y' to continue", "Question")
If question = "n" Then End
Months = Application.InputBox("Enter the Student", "Student")
Cells(erow, 1).Value = Student
Final_Score = 0
Total_Portfolio_Performance = 0
For counter = 2 To 7
TotalScore = Application.InputBox("Enter the Percentage for Grades", "Grades")
Cells(erow, counter).Value = TotalScore
MsgBox "You entered Grade" & " " & counter & " you have " & 7 - counter & " to go"
Final_Score = (Project1 * 150) + (Project2 * 150) + (Exam1 * 200) + (Exam2 * 200) + (FinalExam * 300)
Cells(erow, 9).Value = Final_Score
Dim percentage As Single
percentage = 0
percentage = FinalScore
Cells(erow, 8).Value = percentage
If percentage <= 900 Then
Final_Score = "A"
Cells(erow, 8).Font.Bold = True
Cells(erow, 8).Font.ColorIndex = 5
ElseIf percentage <900 or </= 800 Then
Final_Score = "B"
ElseIf percentage <= 700 or <800 Then
Final_Score = "C"
ElseIf percentage <= 600 or < 700 Then
Final_Score = "D"
ElseIf percentage < 600 Then
Final_Score = "E"
Else
End If
Cells(erow, 8).Value = Final_Score
Next counter
Loop
End Sub
Moderator Note:
Pls use code tags around your code next time as per forum rules.
Bookmarks