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
 

Forum statistics

Threads
1,081,545
Messages
5,359,433
Members
400,528
Latest member
Ratish52

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top