View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Kathryn[_4_] Kathryn[_4_] is offline
external usenet poster
 
Posts: 7
Default Cell comparison to change color on a third cell.

Dannic, you could try something like this. I used "i" to
limit the number of rows I want looked at. If you are
looking at a large number of rows, you could increase to
50, 100, etc.

Option Explicit
Sub Review_WSvalues()
Dim i As Integer

Range("c5").Select 'enter 1st cell of the column w/data
i = 1
While i < 10
If ActiveCell.Value 0 Then
If ActiveCell.Value (ActiveCell.Offset(0, -2).Value
- ActiveCell.Offset(0, -2).Value _
* ActiveCell.Offset(0, -1).Value) And
ActiveCell.Value < (ActiveCell.Offset(0, -2).Value _
+ ActiveCell.Offset(0, -2).Value *
ActiveCell.Offset(0, -1).Value) Then
Selection.Interior.ColorIndex = 37
End If
End If
ActiveCell.Offset(1, 0).Select
i = i + 1
Wend
End Sub
-----Original Message-----
I have a "template" of sorts. Basicly it has several

columns. One
column has the nominal value. The next has a percentage

value and the
third is where the data taken is inserted.

What I would like to do is Take the first value. Find

the upper and
lower limits per the second value. Compare those limits

to the third
value and if it is out of the range of the limits change

the color of
the cell or circle the cell.

I'm not all that familiar with Excel programming and any

help would be
appreciated.

Thanks

Dannic
Http://www.orpgs.com
.