G
Greg
How do I set up the text box. I currently am using the exit code and when i
leave a box when is empty it comes up with the invalid code message box. I
tried the key press code and it comes up with the invalide code in between
key presses.
What should I use?
Private Sub TextBox3_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim ans
On Error Resume Next
ans = Application.Match(TextBox3.Text, Range("c:c"), 0)
If Not IsError(ans) Then
TextBox1.Text = Application.Index(Range("a:a"), ans)
TextBox2.Text = Application.Index(Range("b:b"), ans)
TextBox4.Text = Application.Index(Range("a:a"), ans)
TextBox5.Text = Application.Index(Range("b:b"), ans)
TextBox6.Text = Application.Index(Range("C:C"), ans)
TextBox7.Text = Application.Index(Range("D"), ans)
TextBox8.Text = Application.Index(Range("E:E"), ans)
TextBox9.Text = Application.Index(Range("F:F"), ans)
TextBox10.Text = Application.Index(Range("G:G"), ans)
TextBox11.Text = Application.Index(Range("H:H"), ans)
TextBox12.Text = Application.Index(Range("I:I"), ans)
Else
MsgBox "NOT IN LIST"
End If
On Error GoTo 0
End Sub
Thanks in advance
Greg
leave a box when is empty it comes up with the invalid code message box. I
tried the key press code and it comes up with the invalide code in between
key presses.
What should I use?
Private Sub TextBox3_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim ans
On Error Resume Next
ans = Application.Match(TextBox3.Text, Range("c:c"), 0)
If Not IsError(ans) Then
TextBox1.Text = Application.Index(Range("a:a"), ans)
TextBox2.Text = Application.Index(Range("b:b"), ans)
TextBox4.Text = Application.Index(Range("a:a"), ans)
TextBox5.Text = Application.Index(Range("b:b"), ans)
TextBox6.Text = Application.Index(Range("C:C"), ans)
TextBox7.Text = Application.Index(Range("D"), ans)
TextBox8.Text = Application.Index(Range("E:E"), ans)
TextBox9.Text = Application.Index(Range("F:F"), ans)
TextBox10.Text = Application.Index(Range("G:G"), ans)
TextBox11.Text = Application.Index(Range("H:H"), ans)
TextBox12.Text = Application.Index(Range("I:I"), ans)
Else
MsgBox "NOT IN LIST"
End If
On Error GoTo 0
End Sub
Thanks in advance
Greg