A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Setting up and Configuration
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Setting custom Tab order



 
 
Thread Tools Display Modes
  #1  
Old May 17th, 2007, 05:47 AM posted to microsoft.public.excel.setup
Rusty
external usenet poster
 
Posts: 102
Default Setting custom Tab order

I am building a form in Excel 2003. I want to be able to hit the tab key (or
any key / combination of keys) to automatically move to the next input field
in the form. Is it possible to create a custom tab order or to create a
macro to do this for me? If yes, can you help me do it or at least point me
in the right direction?

Thanks a ton for your help!

Rusty
  #2  
Old May 17th, 2007, 10:21 AM posted to microsoft.public.excel.setup
Bob Phillips
external usenet poster
 
Posts: 5,994
Default Setting custom Tab order

All you need to do is to unlock the cells you want to move into
(FormatCellsProtection), and protect the worksheet.

If you want some exotic order regardless, see
http://xldynamic.com/source/xld.xlFAQ0008.html

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Rusty" wrote in message
...
I am building a form in Excel 2003. I want to be able to hit the tab key
(or
any key / combination of keys) to automatically move to the next input
field
in the form. Is it possible to create a custom tab order or to create a
macro to do this for me? If yes, can you help me do it or at least point
me
in the right direction?

Thanks a ton for your help!

Rusty



  #3  
Old May 17th, 2007, 06:43 PM posted to microsoft.public.excel.setup
Gord Dibben
external usenet poster
 
Posts: 20,252
Default Setting custom Tab order

Rusty

If any of these options at Bob's site aren't what you want, you can use VBA
event code to leap from cell to cell in the order you want as you enter data.

Private Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Address
Case "$C$2"
Range("C5").Select
Case "$C$5"
Range("E2").Select
Case "$E$2"
Range("E5").Select
End Select
End Sub

Or this more robust code from Anne Troy.

Private Sub Worksheet_Change(ByVal Target As Range)
'Anne Troy 's taborder event code
Dim aTabOrd As Variant
Dim i As Long

'Set the tab order of input cells
aTabOrd = Array("A5", "B5", "C5", "A10", "B10", "C10")

'Loop through the array of cell address
For i = LBound(aTabOrd) To UBound(aTabOrd)
'If the cell that's changed is in the array
If aTabOrd(i) = Target.Address(0, 0) Then
'If the cell that's changed is the last in the array
If i = UBound(aTabOrd) Then
'Select first cell in the array
Me.Range(aTabOrd(LBound(aTabOrd))).Select
Else
'Select next cell in the array
Me.Range(aTabOrd(i + 1)).Select
End If
End If
Next i

End Sub


Gord Dibben MS Excel MVP

On Wed, 16 May 2007 21:47:01 -0700, Rusty
wrote:

I am building a form in Excel 2003. I want to be able to hit the tab key (or
any key / combination of keys) to automatically move to the next input field
in the form. Is it possible to create a custom tab order or to create a
macro to do this for me? If yes, can you help me do it or at least point me
in the right direction?

Thanks a ton for your help!

Rusty


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:02 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.