Good Day Experts,
i really had a hard time deciphering whats wrong with this code: my txtrecno.value = 2 in cell B2 but the if statement will still skip my procedure..please help..thank you :dead:
Code
Private Sub CommandButton1_Click()
Dim eRow As Integer
Dim x As Integer
Set WS = Worksheets("TimeSheet")
With WS
If Me.TXTRECNO.Text = "" Or Me.TXTHRS.Text = "" Then
MsgBox "Please Select Job Order to Save.", vbCritical, "Alert"
Else
eRow = Application.WorksheetFunction.CountA(Sheets("TimeSheet").Range("B:B"))
MsgBox " erow is " & eRow
For x = 2 To eRow
If .Cells(x, "B").Value = TXTRECNO.Value Then
.Cells(x, "G") = TXTJOBORDER.Text
.Cells(x, "H") = TXTHRS.Text
else
Msgbox "Not Found"
End If
Next
End If
End With
End Sub
Display More