• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Fetch grade based on Score from Access Table

ravikiran

Member
Hi VBA Gurus,

I need help with this code to fetch the Grade from the following Access Table.

Low Score High Score Grade
39 Fail
40 59 Pass
60 74 1st Class
75 Distinction

I need to fetch the grade based on the value of the variable "lng_Score" from the above table "tbl_Grade."

Please help.

Many thanks in advance.

Cheers,
Ravi.
 
Hi Ravi,
If you are okay with formula solution you can go with the following:
=IF(D2>=75,"Distinction",IF(D2>=60,"1st Class",IF(D2>=40,"Pass",IF(D2<=39,"Fail"))))

Change D2 as per your requirement, and copy down.

Regards,
 
Hi Khalid,

Unfortunately, data is in an Access table and I got to use the VBA to fetch the value.

Any VBA solution to iterate the table and see which grade the value falls and fetch the Grade?

Thanks in advance,

cheers,
Ravi.
 
Back
Top