As the code drops down thu the IF's and ELSEIF's it will exit the IF as soon as a match is made.
Sub test2()
Dim Cel As Range
Dim VRng As Range
Set VRng = Range("B8:D400)
For Each Cel In Range(Range("K8"),Range(K8").End(xlDown))
With Cel
If .Offset(0, -1) = "-" Then
.Value = "-"
ElseIf VLookup(.Offset(0, -4),VRng,1 ,1) <> .Offset(0, -4) Then
.Value = "Pending..."
ElseIf .Offset(0, -4) = .Offset(-1, -4) Then
Value = .Offset(-1, 0).Value
ElseIf Lcase(.Offset(0, -1)) = "ok" Then
.Value = VLookUp(VRng, 3 0)
ElseIf LCase(.Offset(0, -1)) = "ipg" Or LCase(.Offset(0, -1)) ="bad" Then
.Value = VLookup(VRng, 3, 0) + .Offset(-1, 0)
Else: .Value = ""
End If
End With
Next Cel
End Sub
Sub test3()
Dim Cel As Range
Dim VRng As Range
Set VRng = Range("B8:D400)
For Each Cel In Range(Range("K8"),Range(K8").End(xlDown))
With Cel
.Value = ""
Select Case LCase(.Offset(0, -1) )
Case "-": .Value = "-"
Case "ok": .Value = VLookUp(VRng, 3 0)
Case "ipg", "bad": .Value = VLookup(VRng, 3, 0) + .Offset(-1, 0)
End Select
If VLookup(.Offset(0, -4),VRng,1 ,1) <> .Offset(0, -4) Then
.Value = "Pending..."
ElseIf .Offset(0, -4) = .Offset(-1, -4) Then
Value = .Offset(-1, 0).Value
End If
End With
Next Cel
End Sub
Note that the second sub was developed from the first, so If I made an error in the first, that error will be in the second. My "Office" computer is down and I can't test anything.
edit to add: For example, most of the VLookups are missing the first parameter