Can I make the "Enter" key behave like the "Tab" key?
Prep for a pre-employment Excel test with Job Test Prep
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 10 of 10

Thread: Can I make the "Enter" key behave like the "Tab" key?

  1. #1
    Board Regular
    Join Date
    Mar 2002
    Posts
    142
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    I've built a nice spreadsheet that utilizes merged cells of different widths, horizontal positions, etc. Entering a value into a given cell, then pressing the "Enter" key rather than the "Tab" key creates problems in parts of the navigation...but I'd like to give the user the option of using the "Enter" key if they'd like. Soooo...

    Can I make the "Enter" key behave like the "Tab" key?

    Any help would be greatly appreciated!

  2. #2
    New Member
    Join Date
    Feb 2002
    Location
    ]-[ /-\ \/\/ /-\ | | ~~~@|_()]-[/-\!!!
    Posts
    48
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    put in 'thisworkbook' object of your workbook:

    Private Sub Workbook_Activate()
    Application.MoveAfterReturnDirection = xlToRight
    End Sub

    Private Sub Workbook_Deactivate()
    Application.MoveAfterReturnDirection = xlDown
    End Sub

    Aloha!

  3. #3
    Board Regular
    Join Date
    Mar 2002
    Posts
    142
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hey Hawaiian...

    Thanks for your quick reply! Unfortunately, I did exactly as you suggested and it didn't work. (Tried it in a new xls as a test.) Double-checked to make sure I put it in "This Workbook". Cut and pasted your code, so I didn't make a typo.

    Any customization I should be filling in? I'm fairly certain this is an "E-S-O" as it pertains to my lack of expertise when it comes to Excel coding!

    Any further assistance would be pounced upon.

    Thanks.

  4. #4
    New Member
    Join Date
    Feb 2002
    Location
    ]-[ /-\ \/\/ /-\ | | ~~~@|_()]-[/-\!!!
    Posts
    48
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    bobmc,

    I apologize. I'm sure that I didn't understand what you wanted to do, and just took for granted that you wanted the cell selection to go to the right when 'Enter' is pressed (as the 'Tab' key does) instead of downward, which is the default direction. Is that correct?

  5. #5
    Board Regular
    Join Date
    Mar 2002
    Posts
    142
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Yup. That's exactly right. I put the code into the "This Workbook" and when I went back to Sheet1 and pressed the "Enter" key, it still went to the cell below it instead of to the right. I also tried putting the code into the "This Sheet" object and had the same result.

    Lemme know what you think.

    Thanks!

  6. #6
    New Member
    Join Date
    Feb 2002
    Location
    ]-[ /-\ \/\/ /-\ | | ~~~@|_()]-[/-\!!!
    Posts
    48
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    bobmc,

    Did you save the workbook (with the code)? Try saving, closing, then re-opening it, or just open another workbook, then switch back to the workbook with the code in it. It should work okay, but let me know.

  7. #7
    Board Regular
    Join Date
    Mar 2002
    Posts
    142
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hey Hawaiian...

    Well, that was it! It works! I do very much appreciate your help!

    Mahalo.

    bobmc

  8. #8
    New Member
    Join Date
    Feb 2002
    Location
    ]-[ /-\ \/\/ /-\ | | ~~~@|_()]-[/-\!!!
    Posts
    48
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    bobmc,

    Anytime, glad to be of help.

    Aloha!

    p.s. much respect for the lingo-flex *impressed*

  9. #9
    New Member
    Join Date
    Nov 2015
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Can I make the "Enter" key behave like the "Tab" key?

    I am new to this and I really want to use this function. Where exactly do I enter this in? I've tried doing further researching prior to posting this reply but I'm stuck. Help this dummy please? lol

  10. #10
    Board Regular rollis13's Avatar
    Join Date
    Jul 2012
    Location
    Cordenons
    Posts
    245
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Can I make the "Enter" key behave like the "Tab" key?

      
    First you need to go to the VBA Panel to get started: press both keys Alt and F11 then you can follow the suggestions of the thread.

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com