View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Formula for Conditional Formatting

Sub Test()

With ActiveSheet.Range("A1").FormatConditions
.Delete
.Add Type:=xlExpression, _
Formula1:="=OR($F$12<220,$F$12280)"
.Item(1).Interior.ColorIndex = 3
End With

End Sub

Change "A1" to the cell address in which you want the FC

Regards,
Peter T

wrote in message
...
I've recently been asked to create some conditional formatting based
on a cell value. Basically what I am trying to do is have the cell
turn red if the value of a cell is outside of a range.

For example, if the value of cell F12 280 OR < 220 then I want the
cell to turn red. The standard conditional formatting has limitations
so I am left to figure out how to write a formula. Can someone assist
me with this?

Here is what I have so far but it does not seem to be working.

=IF(F12280 OR <220) then?????

Thanks in advance for your help.