Forum Discussion
VBA CODING
[ Function fGrade (score as integer, score_range as range)
C = 100 - worksheetfunction. Max(score_range)
FGrade = score + C
End Function ]
It's not giving expected outcome 😞
What is Fgrade?...certainly not a formula...
Do you mean something like this?
With your permission, I recommend to provide more information.
You'll get a quicker and more accurate answer, and those who want to help don't have to invest time guessing the problem.
I recommend: Always inform about your Excel version, operating system, storage medium/hard drive, OneDrive, Sharepoint, etc.).
If possible, add a file (without sensitive data) and use this file to describe your project step by step, or add photos with the appropriate description.
Don't forget that not every Excel user has a clue about every job and what you see he can't see.
In this link you will find some more information about it:
Welcome to your Excel discussion space!
Thank you for your understanding and patience
Hope I was able to help you with this information.
I know I don't know anything (Socrates)
- NikolinoDEMar 14, 2022Platinum Contributor
Maybe this can help you...otherwise I can't help, maybe someone who knows more about this will get in touch.
Get the Grade based on the Marks Scored
Sub Grade() Dim StudentMarks As Integer Dim FinalGrade As String StudentMarks = InputBox("Enter Marks") Select Case StudentMarks Case Is < 33 FinalGrade = "F" Case 33 To 50 FinalGrade = "E" Case 51 To 60 FinalGrade = "D" Case 60 To 70 FinalGrade = "C" Case 70 To 90 FinalGrade = "B" Case 90 To 100 FinalGrade = "A" End Select MsgBox "The Grade is " & FinalGrade End SubThank you for your patience and time.