Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default using 'enter' on a textbox to activate a command button?

i have atext box which the user types into and then a command butto
next to it to do a search based on their text. what i would like is t
be able to just type the text and press enter in the text box t
perform the same search. Im pretty sure it can be done quite easily a
I remember doing something similar in VB a few years ago, i just can
remember how

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 253
Default using 'enter' on a textbox to activate a command button?

Hi,

Private Sub txtBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
On Error Resume Next
If KeyCode = 13 Then Call yourSub
End Sub
I would make a sub that you either call with the enter key or by the
commandButton.
Don't call the sub under the command button.
Regards,
JY

"neowok " wrote in message
...
i have atext box which the user types into and then a command button
next to it to do a search based on their text. what i would like is to
be able to just type the text and press enter in the text box to
perform the same search. Im pretty sure it can be done quite easily as
I remember doing something similar in VB a few years ago, i just cant
remember how.


---
Message posted from http://www.ExcelForum.com/



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
Is there a way to make the enter button work as regular enter Ricter Excel Discussion (Misc queries) 1 November 17th 09 02:50 AM
repost: How do I activate an option button? Formatting Excel Discussion (Misc queries) 2 March 16th 09 10:51 PM
How do I activate an option button? Option Button Excel Discussion (Misc queries) 14 March 16th 09 10:28 PM
How do I activate right mouse button in Excel Gerhard Setting up and Configuration of Excel 4 April 4th 08 11:51 AM
activate a worksheet formula through a button TUNGANA KURMA RAJU Excel Discussion (Misc queries) 5 November 12th 05 09:28 AM


All times are GMT +1. The time now is 07:59 PM.

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

About Us

"It's about Microsoft Excel"