Im not sure where I screwed up, I need help please
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim f As Range
Dim resp As VbMsgBoxResult
Dim i As Long
For Each f In Range("F475:F554")
If Cells(f.Row, 6).Value = "Completed" Then
If Cells(f.Row, 5).Value = "Running Repair" Then
resp = MsgBox("Is unit returned to service?", _
vbYesNo + vbQuestion)
If resp = vbYes Then
Set f = Range("I:J").Find("RETURNED TO SERVICE", , xlValues, xlPart, , , False)
If Not f Is Nothing Then
i = f.Row + 2
Set f = Range("I:J").Find(Range(f.Row, 1).Value, , xlValues, xlWhole, , , False)
If Not f Is Nothing Then
MsgBox "This unit already exists in the section."
Exit Sub
End If
Do While True
If Range("I" & i).Value = "" Then
Range("I" & i).Value = Range(f.Row, 1).Value
Exit Do
End If
i = i + 1
Loop
End If
End If
End If
End If
Next
End Sub