Can't figure it out. Maybe a fresh set of eyes can see what I don't?
Code:
[COLOR=blue]Private Sub[/COLOR] cmdCreate_Click()
[COLOR=blue]If[/COLOR] Trim(Me.txtRef.Value) = "" [COLOR=blue]Then[/COLOR]
Me.txtRef.SetFocus
MsgBox "Please enter a reference #"
[COLOR=blue]Exit Sub[/COLOR]
[COLOR=blue]End If[/COLOR]
Application.EnableEvents = [COLOR=blue]False[/COLOR]
[COLOR=blue]Dim[/COLOR] LR&, i&
LR = Worksheets("Master").Range("F" & Rows.Count).End(xlUp).Row
[COLOR=blue]For[/COLOR] i = 4 T[COLOR=blue]o[/COLOR] LR
[COLOR=blue]If [/COLOR]Worksheets("Master").Range("F" & i).Value = Me.txtRef.text [COLOR=blue]And[/COLOR] _
Worksheets("Master").Range("P" & i).Value = "" [COLOR=blue]And[/COLOR] _
Worksheets("Master").Range("Q" & i).Value = "" [COLOR=blue]Then[/COLOR]
Worksheets("Master").Range("P" & i).Value = Me.txtFirst.Value
Worksheets("Master").Range("Q" & i).Value = Me.txtPaid.Value
[COLOR=blue]ElseIf [/COLOR]Worksheets("Master").Range("F" & i).Value = Me.txtRef.text [COLOR=blue]And[/COLOR] _
Worksheets("Master").Range("V" & i).Value = "" [COLOR=blue]And[/COLOR] _
Worksheets("Master").Range("W" & i).Value = "" [COLOR=blue]Then[/COLOR]
Worksheets("Master").Range("V" & i).Value = Me.txtFirst.Value
Worksheets("Master").Range("W" & i).Value = Me.txtPaid.Value
[COLOR=blue]ElseIf[/COLOR] Worksheets("Master").Range("F" & i).Value = Me.txtRef.text [COLOR=blue]And[/COLOR] _
Worksheets("Master").Range("AB" & i).Value = "" [COLOR=blue]And[/COLOR] _
Worksheets("Master").Range("AC" & i).Value = "" [COLOR=blue]Then[/COLOR]
Worksheets("Master").Range("AB" & i).Value = Me.txtFirst.Value
Worksheets("Master").Range("AC" & i).Value = Me.txtPaid.Value
[COLOR=blue]ElseIf[/COLOR] Worksheets("Master").Range("F" & i).Value = Me.txtRef.text [COLOR=blue]And[/COLOR] _
Worksheets("Master").Range("AH" & i).Value = "" [COLOR=blue]And[/COLOR] _
Worksheets("Master").Range("AI" & i).Value = "" [COLOR=blue]Then[/COLOR]
Worksheets("Master").Range("AH" & i).Value = Me.txtFirst.Value
Worksheets("Master").Range("AI" & i).Value = Me.txtPaid.Value
[COLOR=blue]Else[/COLOR]: MsgBox "Employee has completed all scheduled payments. Please check for errors in previous dates."
Me.txtFirst.SetFocus
[COLOR=blue]Exit Sub[/COLOR]
[COLOR=blue]End If[/COLOR]
Application.EnableEvents = [COLOR=blue]True[/COLOR]
Me.txtRef.Value = ""
Me.txtFirst.Value = ""
Me.txtPaid.Value = ""
Me.txtRef.SetFocus
[COLOR=blue]End Sub[/COLOR]