Conditional Formatting- targetting columns (Excel 2003)

Status
Not open for further replies.

CASEBUSY

New Member
Joined
Oct 17, 2011
Messages
5
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
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Status
Not open for further replies.

Forum statistics

Threads
1,225,606
Messages
6,185,957
Members
453,333
Latest member
BioCoder84

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top