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
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