HI
I am trying to use conditional formatting in order to change the colour of the cell if a student's grade changes. So for example the cell should change to yellow if if the student achieves a C or change to red if the student gets a D.
The VB code i use does this, if i use 1 column. I need to use more than 1 column and cant work out what to change the code to . This is what i am using at the moment:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 1 Or Target.Cells.Count > 1 Then Exit Sub
With Target.Interior
Select Case UCase(Target.Value)
Case "D"
.ColorIndex = 3
Case "C"
.ColorIndex = 10
Case "B"
.ColorIndex = 5
Case "A"
.ColorIndex = 6
Case Else
.ColorIndex = 0
End Select
End With
End Sub
I am trying to use conditional formatting in order to change the colour of the cell if a student's grade changes. So for example the cell should change to yellow if if the student achieves a C or change to red if the student gets a D.
The VB code i use does this, if i use 1 column. I need to use more than 1 column and cant work out what to change the code to . This is what i am using at the moment:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 1 Or Target.Cells.Count > 1 Then Exit Sub
With Target.Interior
Select Case UCase(Target.Value)
Case "D"
.ColorIndex = 3
Case "C"
.ColorIndex = 10
Case "B"
.ColorIndex = 5
Case "A"
.ColorIndex = 6
Case Else
.ColorIndex = 0
End Select
End With
End Sub