Conditional Formatting

P

Padraigglynn

I have trawled through the discussion group and am unable to find the answer
to a simple question. I want to change the cell colours of a list if they
match to certain items. I have 10 items in total which I wish to highlight on
a list I have. Any help greatly appreciated. Thanks for your help
 
P

Pete_UK

Conditional Formatting can be used to provide up to 3 different
formats (colours etc) depending on some condition, as well as a fourth
(default) format for none of the conditions being met. If you want to
set up to 10 different conditional formats then you will need to use a
macro.

Alternatively, you could download Bob's add-in CFPlus from this link:

http://www.xldynamic.com/source/xld.CFPlus.Download.html

and this will give you up to 30 different Conditional Formats.

Hope this helps.

Pete
 
P

Padraigglynn

Thank you Pete for your reply. I found the download difficult to understand
and I could not get it to operate correctly. I think I will just have to use
the old fashioned manual method.
 
P

Pete_UK

Gord Dibben posted this yesterday in response to a very similar
question:

" ...

If CF'ing numerics, John MCGrimpsey shows how to get up to 6 different
font
colors.

http://www.mcgimpsey.com/excel/conditional6.html


For anything else you are forced to use event code similar to this.


Option Compare Text
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Num As Long
Dim rng As Range
Dim vRngInput As Variant
Set vRngInput = Intersect(Target, Range("D:D"))
If vRngInput Is Nothing Then Exit Sub
On Error GoTo endit
Application.EnableEvents = False
For Each rng In vRngInput
'Determine the color
Select Case rng.Value
Case Is = "A": Num = 10 'green
Case Is = "B": Num = 1 'black
Case Is = "C": Num = 5 'blue
Case Is = "D": Num = 7 'magenta
Case Is = "E": Num = 46 'orange
Case Is = "F": Num = 3 'red
End Select
'Apply the color
rng.Interior.ColorIndex = Num
Next rng
endit:
Application.EnableEvents = True
End Sub


Gord Dibben MS Excel MVP
.... "


Perhaps you could try this.

Pete
 
Top