I know this code is very rough, I am very rusty, the 90s seem so recent. I cannot get the macro below to execute properly. It should go through each cell in a defined range read the value and change the cell background to correspond. The If Then nest works properly for each active cell, but cannot get it to loop through the range. Thank you in advance
Sub Color()
' Changes the cell color to correspond to the letter grade
Dim Grade As Range
Set Grade = Range("L16:L33").Text
Grade.Select
For Each Cell In Grade
If Cell.Value = "A" Then
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 5287936
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End If
If Cell = "C" Then
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End If
Next Cell
End Sub
Bookmarks