View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
chick-racer[_28_] chick-racer[_28_] is offline
external usenet poster
 
Posts: 1
Default Color Coded Cells


actually i have, and cannot get it to work for me.. i'll show you a tiny
slice of my code. i have an endless loop and am very very stuck.

I believe it's the "lowval" that i need to ensure only looks at black
or default color font.
I will then add code to make it find average of the cells with default
font using the same principles.


grubb = Cells(J + K, "V").value
tlow = Cells(J + K, "T").value
thigh = Cells(J + K, "U").value

While tlow grubb

Set rng = Range("D" & J + K, "N" & J + K)
lowval = Application.WorksheetFunction.Min(rng) 'must
only get lowval that is black or default color
For Each newrng In rng.Cells 'both
rng and newrng are set as Range
If newrng.Font.ColorIndex = xlAutomatic Or
newrng.Font.ColorIndex = 1 Then
result = Application.Match(lowval, rng, 0)
If Not IsError(result) Then rng(1,
result).Font.Color = RGB(0, 10, 200)
End If
Next newrng

'update tlow for the 'while' test
tlow = (Cells(J + K, "R").value - lowval) /
(Cells(J + K, "S").value)
Wend 'i think this
should work, it certainly works in my head!


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/