Philcjr

01-11-2010, 08:34 AM

Can someone please help me with this formula:

sFormula3 = "=AND(D" & Z & ">=0.5*$C" & Z - 1 & ",D" & Z & "<=0.8*$C" & Z - 1

.FormatConditions.Add Type:=xlExpression, Formula1:=sFormula3

With .FormatConditions(3).Font

.Bold = True

.ColorIndex = 1

End With

.FormatConditions(3).Interior.ColorIndex = 6

It is trying to putting an extra set of quotations around the formula... causing this not to enter in the conditional format. "Z" would be the Row Number

sFormula3 = "=AND(D" & Z & ">=0.5*$C" & Z - 1 & ",D" & Z & "<=0.8*$C" & Z - 1

.FormatConditions.Add Type:=xlExpression, Formula1:=sFormula3

With .FormatConditions(3).Font

.Bold = True

.ColorIndex = 1

End With

.FormatConditions(3).Interior.ColorIndex = 6

It is trying to putting an extra set of quotations around the formula... causing this not to enter in the conditional format. "Z" would be the Row Number