Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default A question about textboxes


Hi all,

in the userforms i've created, I've always had a user put data into
textbox and then click a command button to do whatever the comman
button does.

However, In the userform that i'm creating right now, i'd like for th
user to put data into the textbox and just press enter and have m
operations carried out instead of having to click a command button. Ho
can this be done?

thanks for the help :

--
abx
-----------------------------------------------------------------------
abxy's Profile: http://www.excelforum.com/member.php...nfo&userid=473
View this thread: http://www.excelforum.com/showthread.php?threadid=26554

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default A question about textboxes


You can use the keydown event to check for an enter.

Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger
ByVal Shift As Integer)
MsgBox KeyCode
If KeyCode = 13 Then
'Your code here
End If
End Sub

You may also want to check for a Tab (KeyCode=9) if they would ever ta
out. Also might need to use TextBox1_Exit event if they mouse out.



--
kkkni
-----------------------------------------------------------------------
kkknie's Profile: http://www.excelforum.com/member.php...nfo&userid=754
View this thread: http://www.excelforum.com/showthread.php?threadid=26554

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
Textboxes SAL Excel Discussion (Misc queries) 2 July 13th 07 12:24 AM
tab between several textboxes Kim Excel Worksheet Functions 0 May 9th 05 04:08 PM
Textboxes Marcotte A Excel Programming 2 July 7th 04 12:55 AM
textboxes libby Excel Programming 5 April 13th 04 06:32 PM
Userfrom textboxes Jo[_6_] Excel Programming 1 October 21st 03 05:47 PM


All times are GMT +1. The time now is 11:24 AM.

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"