jeudi 3 septembre 2015

VBA: action based on multiple ranges

I am very new to VBA and I tried googling several times before posting here. I apologize if something like this has already been asked and answered.

I have a list of numbers from A3:A22 in Column A on Sheet 1 and I am trying to assign a grade based on the value of each number in Column A Sheet 1 in A7:A26 on Sheet 2.

The logic I am trying to use is

If value < 10 Then Grade = 'A'
Else If 10 <= value < 20 then Grade = 'B'
Else If 20 <= value < 50 then Grade = 'C'
Else If 50 <= value < 70 then Grade = 'D'
Else Grade = 'E'

How can I achieve this?

Thanks for your help.

Aucun commentaire:

Enregistrer un commentaire