Hi everyone,
I am a teacher and I am trying to create a grade book in excel where the following conditions exist:
Column B are student names
Column C are student grade averages
Column D is a comment code that relates to the students' averages.
I created the following macro in VBA:
Range("D4").Value = "85"
Case Is < 54.5
Range("D4").Value = "84"
Case Is < 60
Range("D4").Value = "83"
Case Is < 64.5
Range("D4").Value = "82"
Case Is < 70
Range("D4").Value = "81"
Case Is < 74.5
Range("D4").Value = "80"
Case Is < 80
Range("D4").Value = "79"
Case Is < 84.5
Range("D4").Value = "78"
Case Is < 90
Range("D4").Value = "77"
Case Is < 95.5
Range("D4").Value = "76"
Case Is < 100
Range("D4").Value = "75"
Case Is > 100
Range("D4").Value = "75"
Case Is = 100
Range("D4").Value = "75"
Case Else
Range("D4").Value = 0
End Select
What do I do if I need this macro to repeat down column C? Essentially, the values in C should determine what value goes into D on the same row. Is this possible?
Thanks!
I am a teacher and I am trying to create a grade book in excel where the following conditions exist:
Column B are student names
Column C are student grade averages
Column D is a comment code that relates to the students' averages.
I created the following macro in VBA:
Range("D4").Value = "85"
Case Is < 54.5
Range("D4").Value = "84"
Case Is < 60
Range("D4").Value = "83"
Case Is < 64.5
Range("D4").Value = "82"
Case Is < 70
Range("D4").Value = "81"
Case Is < 74.5
Range("D4").Value = "80"
Case Is < 80
Range("D4").Value = "79"
Case Is < 84.5
Range("D4").Value = "78"
Case Is < 90
Range("D4").Value = "77"
Case Is < 95.5
Range("D4").Value = "76"
Case Is < 100
Range("D4").Value = "75"
Case Is > 100
Range("D4").Value = "75"
Case Is = 100
Range("D4").Value = "75"
Case Else
Range("D4").Value = 0
End Select
What do I do if I need this macro to repeat down column C? Essentially, the values in C should determine what value goes into D on the same row. Is this possible?
Thanks!