Thank you. However, for every key I stroke my SUB is called, except when I hit "Intro". ???
I hope you can help me Thank you
Here is my code:
_______________________________________________
Private Sub TxtCodigo_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If KeyAscii = 13 Then
Call CmdConsultar_Click
End If
End Sub
_____________________________________________________
Private Sub CmdConsultar_Click()
' ultimafila = Cells(Rows.Count, 1).End(xlUp).Row
If TxtCodigo = "" Then
MsgBox ("empty code")
ConsultadeServicios.Hide
Exit Sub
Else
TxtDescripcion = Application.WorksheetFunction. _
VLookup(TxtCodigo.Text, Worksheets("Sheet1").Range("a2:b20"), 2, False)
If TxtDescripcion = "" Then
MsgBox ("Code does not exists")
End If
End If
End Sub
___________________________________________________