excel - Change the value of another cell -


i looking excel-vba code directly show text in cell based on value of cell ,let me elaborate . table follows:

  1. i input grades in column cells a3:a13
  2. the code must print corresponding comment on own ,like if a1 - excellent if a2 - work
  3. this code must work entry of range of 40 grade entries

 grades  ------          comments a1      ------          excellent  b2      ------          work harder a1      ------          excellent b1      ------          satisfactory a2      ------          work

the following code continues until finds student in column has not been graded:

sub gradecomments()      dim grade string, comment string     dim integer      = 3 ' starting row      while > 0        grade = range("a" & i).value        if grade = "a1"          comment = "excellent"       elseif grade = "a2"          comment = "good work"       elseif grade = "b1"          comment = "satisfactory"       elseif grade = "b2"          comment = "work harder"       end if        if grade = vbnullstring         exit       else         range("b" & i) = comment         = + 1       end if     loop end sub 

Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

python - NameError: name 'subprocess' is not defined -