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:
- i input grades in column cells a3:a13
- the code must print corresponding comment on own ,like if a1 - excellent if a2 - work
- 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
Post a Comment