Hello this is the current code I have
I want it such that if there is a "/" or "," along with the found value. A message box should pop out. Currently, there seems to be a error. Could you help me edit it?
VBA Code:
Private Sub TextBox1_AfterUpdate()
Dim m As String
Dim rx As String
rx = Trim(TextBox1.Text)
lastrow = Worksheets("sheet1").Cells(rows.Count, 5).End(x1Up).Row
For i = 2 To lastrow
If Worksheets("sheet1").Cells(i, 1).Value = rx Then
TextBox2.Text = Worksheets("sheet1").Cells(i, 2).Value
If rx = (InStr(Me.TextBox1.Value, "/") > 0 Or InStr(Me.TextBox1.Value, ",") > 0) Then
m = MsgBox("Please confirm", vbYesNo, "Double Check")
End If
End If
End Sub
I want it such that if there is a "/" or "," along with the found value. A message box should pop out. Currently, there seems to be a error. Could you help me edit it?