keyascii = 13

E

ermeko

Hi,

Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If KeyAscii = 13 Then
msgbox 123
End If
End Sub

When I press ENTER button there is no msgbox.
How can I make this code work?

Thanks,
 
S

Steven

Private Sub TextBox1_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
If KeyCode = 13 Then
MsgBox "123"
End If
End Sub
 
E

ermeko

This code does not work.

also how can I make Textbox1.setfocus.
It does not work.
 
B

Bob Phillips

It does, I tried it and it is fine.

TextBox1.SetFocus

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top