View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Check for Enter key and change focus?

Look at the exit event.

Look at setfocus for positioning the cursor.

--

Regards,
Tom Ogilvy

"NooK " wrote in message
...
I have a Userform which has a textbox, two Option Buttons and a Add
button.

The user type something in the box, chooses one of the 2 choices and
press Add (To add the data to a Listbox)

Now what I need is that the user can type the number on the textbox
and press Enter to add the data to the listbox (Assuming the option
buttons are already chosen), but neither KeyUp or KeyPress events seems
to listen to the Enter Key on the keyboard.

How can this be done?

Another question is that when the user press the add button I would
like the cursor to go back to the textbox so that he can press Add and
right after type the new data (Without having to click on the text box
again).

Hopefully they can be done.

Best Regards

NooK


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