Tab order on protected sheets

User avatar
ErikJan
BronzeLounger
Posts: 1232
Joined: 03 Feb 2010, 19:59
Location: Terneuzen, the Netherlands

Tab order on protected sheets

Post by ErikJan »

I'd like to control the tab (read: entry) order on a protected sheet. Standard Excel goes from left to right, top to bottom.

I googled and see advanced solutions using the worksheet.change event but I wonder if there would be more simple approaches (although I think I'll need a worksheet.change event anyway).

Some thoughts I have:
1. is there a way to know the current cell and the previous cell?
If yes, I could simply write some VBA code that could look at the last cell and then apply a tab-order to determine the next cell and then change the current cell to that new location

2. another way would be to not use TAB, or arrow right (or enter) to move to a next (or previous) cell but to use a shortcut key-combination (with Application.OnKey) to move forward or backward. Both would call a VBA routine that would look at the current cell and the move the the next or previous cell in a defined order

3. Or I could add buttons to move forward or backward of course... ;-)

Makes sense? Thoughts?

User avatar
ErikJan
BronzeLounger
Posts: 1232
Joined: 03 Feb 2010, 19:59
Location: Terneuzen, the Netherlands

Re: Tab order on protected sheets

Post by ErikJan »

Update: I did create something myself just now. Will need to test a bit more and then I'll try to post that here.

User avatar
HansV
Administrator
Posts: 78437
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Tab order on protected sheets

Post by HansV »

I'd probably use a userform if the order in which data is entered is important...
Best wishes,
Hans

User avatar
ErikJan
BronzeLounger
Posts: 1232
Joined: 03 Feb 2010, 19:59
Location: Terneuzen, the Netherlands

Re: Tab order on protected sheets

Post by ErikJan »

HansV wrote:I'd probably use a userform if the order in which data is entered is important...
Yep, thought about that as well but that will require serious re-programming (in my case) ;-)

snb
4StarLounger
Posts: 574
Joined: 14 Nov 2012, 16:06

Re: Tab order on protected sheets

Post by snb »

I think you'd better restructure the sheet.

User avatar
ErikJan
BronzeLounger
Posts: 1232
Joined: 03 Feb 2010, 19:59
Location: Terneuzen, the Netherlands

Re: Tab order on protected sheets

Post by ErikJan »

After some coding and help from HansV who streamlined the code a bit, I came up with this (see attached file).

It doesn't always work 100% but for my purposes, I think it is easy to implement and relatively simple to use and configure.
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78437
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Tab order on protected sheets

Post by HansV »

That works nicely!
Best wishes,
Hans