ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   keyascii = 13 (https://www.excelbanter.com/excel-programming/378615-keyascii-%3D-13-a.html)

ermeko

keyascii = 13
 
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,

steven

keyascii = 13
 

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



"ermeko" wrote:

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,


ermeko

keyascii = 13
 
This code does not work.

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

"Steven" wrote:


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



"ermeko" wrote:

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,


Bob Phillips

keyascii = 13
 
It does, I tried it and it is fine.

TextBox1.SetFocus

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)
"ermeko" wrote in message
...
This code does not work.

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

"Steven" wrote:


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



"ermeko" wrote:

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,





All times are GMT +1. The time now is 01:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com