+ Reply to Thread
Results 1 to 14 of 14

Changing how "Enter" works on a Userform

  1. #1
    Registered User
    Join Date
    10-11-2016
    Location
    Aberdeen, Scotland
    MS-Off Ver
    2010
    Posts
    49

    Question Changing how "Enter" works on a Userform

    All,

    Random one for you.

    I have a user form with a set of boxes and then some buttons. When a user presses "Enter" they automatically press a button, no matter which box they are in. How do I change "Enter" to working like "tab"

    Sorry it is really hard to explain but I hope this make sense, and is an easy fix.

    R

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Changing how "Enter" works on a Userform

    Hello rpjwhite,

    And what shall we do if we need to really "Enter" something somewhere, and all it does, is "Tab" to the next input field?

    Please atach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

    Thank you.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  3. #3
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Changing how "Enter" works on a Userform

    I reckon one of your buttons has its default property set to true. make sure they're all false
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  4. #4
    Registered User
    Join Date
    10-11-2016
    Location
    Aberdeen, Scotland
    MS-Off Ver
    2010
    Posts
    49

    Re: Changing how "Enter" works on a Userform

    JosephP - You were correct but it doesn't fix the ?Tabstop? issue.
    Winon - Deep thought. I will try JosephP fix and see how my users get on.

    Thanks both
    R

  5. #5
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Changing how "Enter" works on a Userform

    enter should work like tab by default. what does it do now that it doesn't press the button?

  6. #6
    Registered User
    Join Date
    10-11-2016
    Location
    Aberdeen, Scotland
    MS-Off Ver
    2010
    Posts
    49

    Re: Changing how "Enter" works on a Userform

    Interestingly it varies:
    So in a combo box it does nothing even in an option is selected.
    In a single line textbox it goes to the next text box
    On a mulitline textbox - next line
    On an Optionbutton... Nothing - I can live with that

    But is not not pressing yes on one of the buttons which is good. Winon is correct is some case I want it to work like tab in other I want it to work like enter..

    R

  7. #7
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Changing how "Enter" works on a Userform

    is your combo box style set to 2? a multiline text box with its enterkeybehavior set to true will use the enter key for a new line. if you don't want that, set it to false. might could confuse the user though ;-)
    Last edited by JosephP; 02-09-2017 at 09:41 AM.

  8. #8
    Registered User
    Join Date
    10-11-2016
    Location
    Aberdeen, Scotland
    MS-Off Ver
    2010
    Posts
    49

    Re: Changing how "Enter" works on a Userform

    Yes it. Will that stop it playing?

  9. #9
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Changing how "Enter" works on a Userform

    yeah if it's set to 2 the enter key won't tab

  10. #10
    Registered User
    Join Date
    10-11-2016
    Location
    Aberdeen, Scotland
    MS-Off Ver
    2010
    Posts
    49

    Re: Changing how "Enter" works on a Userform

    Ah Well.

    To be fair you have fixed the problem. A colleague did suggest I write some code so every time they pressed "enter" a message box flashed up with "Press Tab!!"

    Thanks again

    R

  11. #11
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Changing how "Enter" works on a Userform

    if you're gonna do that you could just tab for them!

    thanks for the rep-btw josie is a girl's name ;-)

  12. #12
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Changing how "Enter" works on a Userform

    @ JosephP,

    Great solution brethren!

    Rep added.

    Regards.

  13. #13
    Registered User
    Join Date
    10-11-2016
    Location
    Aberdeen, Scotland
    MS-Off Ver
    2010
    Posts
    49

    Re: Changing how "Enter" works on a Userform

    @JosephP

    Apologise Josie, I missed you initial signature...

    #embarrassed face#

  14. #14
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Changing how "Enter" works on a Userform

    nae bother (is that right?)

    it ain't your fault the forum only shows a signature once!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] "Enter" going to next line inside a textbox on a userform
    By brucemc777 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-14-2016, 04:08 PM
  2. [SOLVED] IF CELL is "Yes" the enter "Enabled" IF CELL is "No" enter "Disabled"
    By king10001 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-10-2016, 09:33 AM
  3. "If statement" works, but not "select case". What am I doing wrong?
    By max3732 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-19-2014, 12:39 PM
  4. Replies: 1
    Last Post: 03-31-2014, 08:39 PM
  5. [SOLVED] Pasting values between ranges in different workbooks: "Range" works but "Cells" doesn't
    By Flaubert in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-13-2013, 01:19 PM
  6. Open files from FTP server (works with "servername" but doesn't work with "ip address")
    By adammsu1983 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-24-2012, 04:30 PM
  7. Enter Data on "Main" or "Input" Sheet and Copy to One of Many Other Sheets
    By timothy_no7 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-21-2012, 07:29 PM

Tags for this Thread

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