Hi makumbi,
You are defining the function to returning String value, but not returning any value from it.
You need to modify the function to return a value from it.
Refer below function.
Public Function grading(tt As Integer) As String
Dim grade As String = Nothing
If IsNothing(tt) Then
grade = Nothing
Return grade
Exit Function
End If
tt = Int(tt)
If (tt >= 0 And tt <= 44) Then
grade = "E"
ElseIf (tt > 45 And tt <= 54) Then
grade = "D"
ElseIf (tt > 55 And tt <= 64) Then
grade = "C"
ElseIf (tt > 65 And tt <= 79) Then
grade = "B"
ElseIf (tt > 80 And tt <= 100) Then
grade = "A"
End If
Return grade
End Function