complex conditional format

T

TUNGANA KURMA RAJU

I have a cell value based on a calculation,which gives me any one of 7
values.The cell values are:-"DEAD","DEAD & DEAD","DEAD & LIVE","LIVE &
DEAD","LIVE","LIVE & LIVE",BLANK CELL. I would like to apply conditional
format of that cell-"DEAD" word to red bold font 11 with a color shade,and
"LIVE" word to blue bold font11 with the same color shade.Since I can apply
only three conditions and a cell value can't accept two formats at a time,I
am unable to do the task.Can any one suggest me how to do this.
 
B

Bob Phillips

It can't be done. Using VBA you could get two different font colours, but
not with CF.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
T

TUNGANA KURMA RAJU

Thanks,but I am new to VBA ,can you give me simple VBA code to apply this two
clors to this cell value
 
B

Bob Phillips

Here is some code

Dim iPos As Long

With ActiveCell
iPos = InStr(.Value, "DEAD")
.Characters(iPos, 4).Font.Color = vbRed
iPos = InStr(.Value, "LIVE")
.Characters(iPos, 4).Font.Color = vbBlue
End With

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
T

TUNGANA KURMA RAJU

Thanks Bob,for testing purpose I have entered the code you have given,it gave
me error 'invalid outside procedure'.I have all of my 7 cell values in a
column and tested.
can you plese give me correct code.I have a column range with these 7 values
which I have mentioned in my question.please give me event macro as my
worksheet contains these values based on sheet calculation.Please remember
there is a string '&' between these words in some cells which contain two
words "DEAD" and "LIVE".Thanks in advance.
 
Top