but I'm afraid you misunderstood me.
Most likely
Now, the last table I sent and the addition in the columns P , Q , R - was only if you need in the calculation and tests to compare them.
OPQR cols implied that each row might have different thresh holds
I'm not that good at writing macros, but I have a feeling that you always take the values that are in/from O4:R4, and maybe I don't understand the macro and it takes its values from each row adjacent to it (so must be).
Yes, not required but easier since otherwise the 4 thresh holds would have to be passed to the sub. That was my first approach but I decided that it was not very elegant. I can put it back if it's a problem
I can't figure out where you get that 4,5,6,7,8,9 and 17.
The subroutine definition might give you a hint since I like to give variables meaningful names
Private Sub AddCF(rowNum As Long)
Dim T1 As Long, T2 As Long, T3 As Long, T4 As Long
Dim CFormula As String
Dim R As Range
Set R = ActiveSheet.Rows(rowNum)
In the last file you sent me, I decided to try and test by plotting numbers on row 21 and when I hit the macro, nothing like coloring came out on that row.
I didn't spend time doing every row, I only did some that had a value in OPQR, I just didn't include row 21
Call AddCF(15)
Call AddCF(17)
Call AddCF(21)
It's easy enough to have the macro do all rows, keying off of OPRQ values (skip rows where the col O is blank
Sub DoAllRows()
Dim r As Long
With ActiveSheet
With .Range("C3:N60")
.FormatConditions.Delete
.Interior.ColorIndex = xlColorIndexNone
'clear any empty, but text i.e. 0 length strings
Call .Replace(vbNullString, "###ZZZ###", LookAt:=xlWhole)
Call .Replace("###ZZZ###", vbNullString, LookAt:=xlWhole)
'clear the settings
.Find What:=vbNullString, After:=.Cells(1, 1), LookIn:=xlFormulas, LookAt:=xlPart, _
SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False
.Replace What:=vbNullString, Replacement:=vbNullString, ReplaceFormat:=False
End With
For r = 3 To 60
Call AddCF(r)
Next r
End With
End Sub