martynball
04-27-2010, 02:08 PM
I get this error:
Run-Time Error '1004':
Application-defined or object-defined error
When trying to run this code:
Private Sub nGrade()
Dim currentGrade, nextGrade As Integer
Select Case Sheets("Final Grade Sheet").Range("J12").Value
Case "Fail"
currentGrade = Sheets("Final Grade Sheet").Range(E15)
Case "PM"
currentGrade = Sheets("Final Grade Sheet").Range("E16")
Case "MM"
currentGrade = Sheets("Final Grade Sheet").Range("E17")
Case "MD"
currentGrade = Sheets("Final Grade Sheet").Range("E18")
End Select
nextGrade = currentGrade - Sheets("Final Grade Sheet").Range("K9")
Sheets("Marks Sheet").Range("P1").Value = nextGrade
End Sub
I have added a msgbox in multiple places and it seems to not display when I put it under the "Select Case" function.
Run-Time Error '1004':
Application-defined or object-defined error
When trying to run this code:
Private Sub nGrade()
Dim currentGrade, nextGrade As Integer
Select Case Sheets("Final Grade Sheet").Range("J12").Value
Case "Fail"
currentGrade = Sheets("Final Grade Sheet").Range(E15)
Case "PM"
currentGrade = Sheets("Final Grade Sheet").Range("E16")
Case "MM"
currentGrade = Sheets("Final Grade Sheet").Range("E17")
Case "MD"
currentGrade = Sheets("Final Grade Sheet").Range("E18")
End Select
nextGrade = currentGrade - Sheets("Final Grade Sheet").Range("K9")
Sheets("Marks Sheet").Range("P1").Value = nextGrade
End Sub
I have added a msgbox in multiple places and it seems to not display when I put it under the "Select Case" function.