nuraisyah,
Do you need to loop?
No loop and conditional format.
Sub tst()
Dim lastrow As Long, erow As Long
With Sheets("PO Summary")
lastrow = .Cells(Rows.Count, 2).End(xlUp).Row
erow = 4
With .Range("h" & erow & ":h" & lastrow)
.FormatConditions.Delete
.Offset(, 1).Formula = "=(f" & erow & "-g" & erow & ")/f" & erow
.Formula = "=if(g4<=0,""Insufficient"",""Sufficient"")"
.FormatConditions.Add Type:=xlExpression, Formula1:="=h" & erow & "=""Insufficient"""
.FormatConditions(1).Font.Bold = True
.FormatConditions(1).Font.Color = vbYellow
.FormatConditions(1).Interior.Color = vbRed
End With
End With
End Sub
Bookmarks