Conditional formating in VBA from Excel 2000 to 2003

gurj_sandhu

New Member
Joined
Oct 30, 2008
Messages
30
Hi guys,

I've used some VBA coding to conditionaly format some cells in my spreadsheet (in Excel 2000), it all seems to work fine, however, when i sent the spreadsheet to a colleague (who is running 2003) it doesnt seem to work.

Im assuming that the only reason its not working is because of the version of Excel i am using, can anyone clarify and if this is the case advise how i can correct this.

The code ive used is below, its saved in the worksheet im working on so not sur what else it can be.

Thanks in advance.



Private Sub Worksheet_Change(ByVal Target As Range)
Dim oCell As Range
For Each oCell In Target
Select Case oCell.Value
Case Is = "GC", "gc"
oCell.Interior.Color = RGB(223, 205, 131)
Case Is = "SH", "sh"
oCell.Interior.Color = RGB(67, 140, 181)
oCell.Font.Color = RGB(255, 255, 255)
Case Is = "JR", "jr"
oCell.Interior.Color = RGB(241, 33, 241)
oCell.Font.Color = RGB(255, 255, 255)
Case Is = "PH", "ph"
oCell.Interior.Color = RGB(255, 255, 170)
Case Is = "TB", "tb"
oCell.Interior.Color = RGB(100, 150, 255)
Case Is = "JT", "jt"
oCell.Interior.Color = RGB(118, 4, 244)
oCell.Font.Color = RGB(255, 255, 255)
Case Is = "TC", "tc"
oCell.Interior.Color = RGB(170, 255, 0)
Case Is = "TL", "tl"
oCell.Interior.Color = RGB(255, 114, 255)
Case Is = "GP", "gp"
oCell.Interior.Color = RGB(80, 255, 255)
Case Is = "MD", "md"
oCell.Interior.Color = RGB(205, 255, 70)
Case Is = "IG", "ig"
oCell.Interior.Color = RGB(155, 205, 255)
Case Is = "PS", "ps"
oCell.Interior.Color = RGB(225, 255, 225)
Case Is = "CM", "cm"
oCell.Interior.Color = RGB(134, 249, 55)
Case Is = "VL", "vl"
oCell.Interior.Color = RGB(164, 255, 255)
Case Is = "AM", "am"
oCell.Interior.Color = RGB(197, 198, 190)
Case Else
oCell.Interior.ColorIndex = xlNone


End Select
Next oCell
End Sub
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Forum statistics

Threads
1,223,214
Messages
6,170,771
Members
452,353
Latest member
strainu

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