Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
sc sc is offline
external usenet poster
 
Posts: 28
Default Using the enter key

I have a textbox and two commandbuttons on a userform. One of the buttons is
to unload the userform and the other is to add the contents from the textbox
to a worksheet. I do not want to click the button everytime. I would just
like to press the enter key to execute the code. I have looked every where
to see how this is done but with no success. Any help will be much
appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Using the enter key

Hi SC,

Try:

'=============
Private Sub UserForm_Initialize()
Me.CommandButton1.Default = True
End Sub
'<<=============



---
Regards,
Norman



"sc" wrote in message
...
I have a textbox and two commandbuttons on a userform. One of the buttons
is
to unload the userform and the other is to add the contents from the
textbox
to a worksheet. I do not want to click the button everytime. I would
just
like to press the enter key to execute the code. I have looked every
where
to see how this is done but with no success. Any help will be much
appreciated.



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
Macro to select cells in column enter data then press enter NP New Users to Excel 1 February 20th 08 04:21 PM
Enter multiple numbers in a cell so total shows when enter keypres newbie Excel Worksheet Functions 2 August 19th 07 12:23 PM
Enter info in one sheet, auto enter in another based on one field The BusyHighLighter[_2_] New Users to Excel 1 August 1st 07 10:54 PM
What does hitting Ctrl + Shift + Enter to enter a formula do??? Help a n00b out. qwopzxnm Excel Worksheet Functions 2 October 20th 05 09:06 PM
enter data on 1 sheet and make it enter on next avail row on 2nd s Nadia Excel Discussion (Misc queries) 27 September 9th 05 03:39 PM


All times are GMT +1. The time now is 02:44 AM.

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"