ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   can someone help me with code for tab/enter stops? (https://www.excelbanter.com/excel-programming/401494-re-can-someone-help-me-code-tab-enter-stops.html)

ward376

can someone help me with code for tab/enter stops?
 
You could use sheet protection to get the behaviour you described.

Select the cells that you want the cursor to move through, then go to
formatcellsprotection and uncheck the "locked" checkbox. Then go to
ToolsProtection and uncheck the "Select locked cells" checkbox (make
sure the "Select unlocked cells" and "Protect worksheet and contents
of loicked cells" boxes are checked.).

Tab will move exactly how you described, but getting enter to do it
enter requires another step assuming your cursor is set to move down
on Enter: use this line in the sheet activate event:

Application.MoveAfterReturnDirection = xlToRight
on deactivate:
Application.MoveAfterReturnDirection = xlDown

Or if you would like the cursor to always go to the right on enter, go
to ToolsOptionsEdit and choose "Right" from the "Move selection
after Enter" item.

Cliff Edwards




All times are GMT +1. The time now is 12:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com