![]() |
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 |
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/ |
All times are GMT +1. The time now is 05:20 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com