Thread: Colouring cells
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Harald Staff Harald Staff is offline
external usenet poster
 
Posts: 292
Default Colouring cells

Hi Sam

Sub test()
With ActiveCell
Select Case .Value
Case 1
.Interior.ColorIndex = 12
Case 2
.Interior.ColorIndex = 19
Case 3
.Interior.ColorIndex = 23
Case 4
.Interior.ColorIndex = 5
Case 5
.Interior.ColorIndex = 36
Case Else
.Interior.ColorIndex = xlNone
End Select
End With
End Sub

Replace "Activecell" with whatever single-cell range you want to colorize.

HTH. Best wishes Harald

"Sam A" skrev i melding
...
As you can only do 3 conditional formats - I have been
pointed to donig this is VB. Any ideas!!
I want to colour cells if the value is equal to a number -
1,2,3,4 or 5. Need to be a different colour for each
result.
thanks
Sam