Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default 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,
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 389
Default 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,

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default 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,

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default 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,



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
KeyAscii won't capture the <Tab key Peter T Excel Programming 4 October 2nd 06 12:38 AM
KeyAscii won't capture the <Tab key Bob Phillips Excel Programming 0 October 1st 06 09:39 AM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"