I have the following code which sets a conditional format. However, when I look at the conditional format of any cell in the range C2:K200, the formula is different. It references the wrong cell. For example, after running the code, the formula for cell C2 is now
=IF(ISNUMBER(B2),IF(B2<0.298,TRUE,FALSE),FALSE)
B2 should be C2.
ThisWorkbook.Sheets("Inspection").Range("$C$2:$K$200").FormatConditions.Delete
'Highlight Thin Spots
ThisWorkbook.Sheets("Inspection").Range("$C$2:$K$200").FormatConditions.Add Type:=xlExpression, _
Formula1:="=IF(ISNUMBER(C2),IF(C2<" & dMinPlateThickness & ",TRUE,FALSE),FALSE)"
ThisWorkbook.Sheets("Inspection").Range("$C$2:$K$200").FormatConditions(1).Interior.ColorIndex = 46
Any help would be appreciated.
=IF(ISNUMBER(B2),IF(B2<0.298,TRUE,FALSE),FALSE)
B2 should be C2.
ThisWorkbook.Sheets("Inspection").Range("$C$2:$K$200").FormatConditions.Delete
'Highlight Thin Spots
ThisWorkbook.Sheets("Inspection").Range("$C$2:$K$200").FormatConditions.Add Type:=xlExpression, _
Formula1:="=IF(ISNUMBER(C2),IF(C2<" & dMinPlateThickness & ",TRUE,FALSE),FALSE)"
ThisWorkbook.Sheets("Inspection").Range("$C$2:$K$200").FormatConditions(1).Interior.ColorIndex = 46
Any help would be appreciated.