View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ward376 ward376 is offline
external usenet poster
 
Posts: 360
Default 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