![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Posts: 142
|
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 |
|
New Member
Join Date: Feb 2002
Location: ]-[ /-\ \/\/ /-\ | | ~~~@|_()]-[/-\!!!
Posts: 48
|
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 |
|
Board Regular
Join Date: Mar 2002
Posts: 142
|
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 |
|
New Member
Join Date: Feb 2002
Location: ]-[ /-\ \/\/ /-\ | | ~~~@|_()]-[/-\!!!
Posts: 48
|
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 |
|
Board Regular
Join Date: Mar 2002
Posts: 142
|
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 |
|
New Member
Join Date: Feb 2002
Location: ]-[ /-\ \/\/ /-\ | | ~~~@|_()]-[/-\!!!
Posts: 48
|
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 |
|
Board Regular
Join Date: Mar 2002
Posts: 142
|
Hey Hawaiian...
Well, that was it! It works! I do very much appreciate your help! Mahalo. bobmc |
|
|
|
|
|
#8 |
|
New Member
Join Date: Feb 2002
Location: ]-[ /-\ \/\/ /-\ | | ~~~@|_()]-[/-\!!!
Posts: 48
|
bobmc,
Anytime, glad to be of help. Aloha! p.s. much respect for the lingo-flex *impressed* |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|