Conditional formating question

P

Petert

I amtrying to set up conditional formating, the plan is thus:

If I have numbers in cells M4 & O4 that total 3 or greater, the sum
will appear in P4, i.e. I have "1" in M4 and "4" in O4 the value of
P4 will be "5"

If the value in P4 is equal to or greater than "3" then I want the
text in M4 & O4 to be red.

Anyone any suggestions how I may achieve this?
--
Cheers

Peter

(Reply to address is a spam trap - pse reply to the group)
 
P

Petert

I amtrying to set up conditional formating, the plan is thus:

If I have numbers in cells M4 & O4 that total 3 or greater, the sum
will appear in P4, i.e. I have "1" in M4 and "4" in O4 the value of
P4 will be "5"

If the value in P4 is equal to or greater than "3" then I want the
text in M4 & O4 to be red.

Anyone any suggestions how I may achieve this?


Sorry, should have mentioned I'm using Excel 2003
--
Cheers

Peter

(Reply to address is a spam trap - pse reply to the group)
 
R

Robert Crandal

I don't have Excel 2003, but I'll give this a try.....

Basically, you will need to monitor whenever cell "P4"
experiences a "change" event. If the value of cell P4
changes, test if the value of P4 is greater than 5. If
so, then change the font color of your desired cells.

The following code works in Excel 2007. Hopefully
this will be compatible with Excel 2003. I'm not sure.
(Also, this code can probably be simplified even more)

'=============================================
Private Sub Worksheet_Change(ByVal Target As Range)
'
' Did cell P4 change? (which corresponds to row 4, column 16)
'
If (Target.Row = 4) And (Target.Column = 16) Then
If Range("P4").value > 5 then
Range("M4").Font.Color = 255
Range("O4").Font.Color = 255
End If
End If

End Sub
'==============================================

hope it works!
 
N

norie

Peter

Select M4 and O4.

Goto Format>Conditional formatting...

Select cell formula is, enter this formula and format as required

=$P4>3

If you need to apply this to more rows in columns M and O then select
the range(s) and repeat the above steps.

One thing you don't need to do is change the formula, Excel will
automatically adjust it.

eg in M5 & O5 it will be =$P5>3
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top