Greetings, I thought I had a good handle on If/Then's but apparently not. I am using the code below in a userform to look for missing entries in a WS, and everything with the first Msgbox works as it is supposed to. I decided to add in the second Msgbox and now no matter what value is in (i,7) I always get the second Msgbox. I can't figure out what I am missing, I am guessing that "Else" is the wrong one to use? I appreciate any insight - thanks,
VBA Code:
Private Sub RepairButton_Click()
Dim i As Long
Dim Lastrow As Long
Worksheets("Device List").Activate
Lastrow = Cells(Rows.Count, "A").End(xlUp).Row
For i = 1 To Lastrow
If Cells(i, 8).Value = "FAIL" And Cells(i, 7).Value = "" Then
MsgBox "Repair comments required"
RepairForm.Show
Else
MsgBox "No repairs are needed"
Exit For
End If
Next
End Sub