Hi! How do you control the tab sequence?

Microsoft Microsoft office excel 2007 -...
December 31, 2010 at 21:20:53
Specs: Windows Vista
I use Excel 2007 and I have created a template form. However when I tab thru the form it goes from Left to Right. I want to customize the tabbing so user can complete one section of the form first and then go to the top and complete another section of the form. Example (A1,A2,A3 then D2,D3,D4). The worksheet will be sheet protected once the form is deployed. Can anyone help? I've tried naming a range but that doesn't seem to do what I want.

See More: Hi! How do you control the tab sequence?

Report •

December 31, 2010 at 21:52:00
This will work for the example you've given and could certainly be modified/expanded to cover a much longer list of cells.

The code doesn't have to be individual lines for each cell, but since I don't know the actual ranges you are working with, this is just an example of how it could work.

Right Click the sheet tab for the sheet your are working with, choose View Code and paste the code into pane that opens.

The enter something in A1, A2, etc.

For the purposes of this exercise, the code loops back to A1 after data is entered in D3.

Private Sub Worksheet_Change(ByVal Target As Range)
 If Target.Address = "$A$1" Then Range("A2").Select
 If Target.Address = "$A$2" Then Range("A3").Select
 If Target.Address = "$A$3" Then Range("D1").Select
 If Target.Address = "$D$1" Then Range("D2").Select
 If Target.Address = "$D$2" Then Range("D3").Select
 If Target.Address = "$D$3" Then Range("A1").Select
End Sub

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.

Report •
Related Solutions

Ask Question