+ Reply to Thread
Results 1 to 5 of 5

Pressing Enter after filling a text box

  1. #1
    Registered User
    Join Date
    02-06-2009
    Location
    Washington, DC, USA
    MS-Off Ver
    Excel 2010
    Posts
    49

    Pressing Enter after filling a text box

    I am wondering whether there is a way to program a user form so that, if you press Enter after filling in a text box, it will accept the entry and close the user form without the user having to click on the OK button.
    Last edited by cmcgath; 09-13-2010 at 12:29 PM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Pressing Enter after filling a text box

    Try this
    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

  3. #3
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Pressing Enter after filling a text box

    Set the Default property of the button to true and pressing Enter will be the same as clicking on it
    Remember what the dormouse said
    Feed your head

  4. #4
    Registered User
    Join Date
    02-06-2009
    Location
    Washington, DC, USA
    MS-Off Ver
    Excel 2010
    Posts
    49

    Re: Pressing Enter after filling a text box

    Thanks for the reply. I do not mean a command button. I am asking if there is any way I can use the Enter key after I finish my input into a text box and get the program to accept the value without making the user click on "OK".

  5. #5
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Pressing Enter after filling a text box

    Your post implied you have a button already. If you don't, then use Roy's code (but it's bad form design IMO).

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1