Hi Folks,
Could someone tell me where i am going wrong please with the following code.
With this part of the code:
I am trying to say TextBox4.text is the same as what is in rows C then do nothing.
But if it is does not match what is in row c then show msgbox"HELP".
The error i am getting is no matter what i put in the textbox4 the msgbox"HELP" always shows.
Thanks
Could someone tell me where i am going wrong please with the following code.
Code:
Private Sub TextBox4_Change()
If Workbooks("Beck.xls").Worksheets("Time Sheet Compile").Range("BL6") = "HANDOVER" Then
If Len(Me.TextBox4.Value) > 5 Then 'only fire off if the code is 6 characters long or more
Dim ctl As MSForms.Control
Dim i As Integer
With Workbooks("Team Leader.xls").Sheets("QC Check Sheet Archive")
Private Sub TextBox4_Change()
If Workbooks("Beck.xls").Worksheets("Time Sheet Compile").Range("BL6") = "HANDOVER" Then
If Len(Me.TextBox4.Value) > 5 Then 'only fire off if the code is 6 characters long or more
Dim ctl As MSForms.Control
Dim i As Integer
With Workbooks("Team Leader.xls").Sheets("QC Check Sheet Archive")
For i = 5 To 200
If Me.TextBox4.Text = .Cells(i, "C") Then
Exit Sub
Else
MsgBox "HELP"
Exit Sub
End If
Next
End With
End If
End If
End Sub
With this part of the code:
Code:
If Me.TextBox4.Text = .Cells(i, "C") Then
Exit Sub
Else
MsgBox "HELP"
Exit Sub
End If
I am trying to say TextBox4.text is the same as what is in rows C then do nothing.
But if it is does not match what is in row c then show msgbox"HELP".
The error i am getting is no matter what i put in the textbox4 the msgbox"HELP" always shows.
Thanks