Hello,
I would like to detect if the user hits the {ENTER} key to be able to perform operation in a UserForm.
I feel it's a very basic question, but can't find out myself!
Thx in advance,
D
Hello,
I would like to detect if the user hits the {ENTER} key to be able to perform operation in a UserForm.
I feel it's a very basic question, but can't find out myself!
Thx in advance,
D
You can use the KeyUp of a commandbutton
Please Login or Register to view this content.
Hope that helps.
RoyUK
--------
For Excel Tips & Solutions, free examples and tutorials why not check out my web site
Free DataBaseForm example
If you want to check to see if they pressed enter within a textbox (assuming your form doesn't have a default command button), this could also work:
Please Login or Register to view this content.
It seems I haven't been clear enough...
I want to detect if the user hit the enter key but without the need of asking him the question!
A calendar is open, the user can move from date to date using the arrows, I want him to confirm the date he wants with the enter button of the keyboard (instead of clicking with the mouse).
The suggestion of Paul seems perfect, but doesn't work on my end. I tried the KeyDown property in the UserForm code, and in the Calendar1 code, but also the KeyPress and Enter properties with no more luck. See code below.
I feel that I am on the good path, but a little something seems to be missing...
D
Please Login or Register to view this content.
Please Login or Register to view this content.
Please Login or Register to view this content.
Please Login or Register to view this content.
This worked fine for me:
Please Login or Register to view this content.
It works!
I don't know what I did wrong, but everything is working perfectly now!
Thx again 4 your fast answers
D
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks