View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Conditional Formatting - Getting pass the 3 condition limit

Right-click on the worksheet tab and "View Code"

Copy/paste this code into that module.

Private Sub Worksheet_Change(ByVal Target As Range)
Set r = Range("A:A") 'adjust to suit your range
If Intersect(Target, r) Is Nothing Then
Exit Sub
End If
vals = Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) 'your 15 numbers will go here
nums = Array(8, 9, 6, 3, 7, 4, 20, 10, 16, 15) 'you need 15 colorindex numbers
For Each rr In r
icolor = 0
For i = LBound(vals) To UBound(vals)
If rr.Value = vals(i) Then
icolor = nums(i)
End If
Next
If icolor 0 Then
rr.EntireRow.Interior.ColorIndex = icolor
End If
Next
End Sub

This code has been tested with 10 numbers in the vals array
The nums array is the colorindex numbers from the Excel color palette

You will have to adjust and edit to suit.

For a list of the colorindex numbers see David McRitchie's site

http://www.mvps.org/dmcritchie/excel/colors.htm

When editing is complete, Alt + q to return to the Excel window.

As always, do all of this on a copy of the worksheet or workbook.


Gord Dibben MS Excel MVP

On Wed, 14 May 2008 09:30:02 -0700, Judy Rose
wrote:

I also need this help and am not sure how to access the VBE in the system, in
addition I am referencing a list of 15 numbers each corresponds to a
different background and need the background to fill an entire row selection
based on the number in the given column. This is for color tracking of
application data as the application works its way through the process each
number corresponds to a step in the process and I want the row of data to
change automatically when I change the number on the row.

Thank you.
--
Judy Rose Cohen