Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I've create a form and I want to be able to tab through the the unlock cells
in a certain order. Now when I hit the tab key it tabs from left to right by rows. I want to set the order of the "tabbing" with maybe a macro. Is this possible?-- Garyw |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
See http://www.xldynamic.com/source/xld.xlFAQ0008.html
-- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Garyw" wrote in message ... I've create a form and I want to be able to tab through the the unlock cells in a certain order. Now when I hit the tab key it tabs from left to right by rows. I want to set the order of the "tabbing" with maybe a macro. Is this possible?-- Garyw |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
In addition to what you find on Bob's site, here is event 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 This is sheet event code. Right-click on the sheet tab and "View Code". Copy/paste the above into that sheet module. Gord Dibben MS Excel MVP On Fri, 30 Mar 2007 08:18:02 -0700, Garyw wrote: I've create a form and I want to be able to tab through the the unlock cells in a certain order. Now when I hit the tab key it tabs from left to right by rows. I want to set the order of the "tabbing" with maybe a macro. Is this possible?-- Garyw |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I can't get Anne's code to work. I've checked it several times.
-- Garyw "Gord Dibben" wrote: In addition to what you find on Bob's site, here is event 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 This is sheet event code. Right-click on the sheet tab and "View Code". Copy/paste the above into that sheet module. Gord Dibben MS Excel MVP On Fri, 30 Mar 2007 08:18:02 -0700, Garyw wrote: I've create a form and I want to be able to tab through the the unlock cells in a certain order. Now when I hit the tab key it tabs from left to right by rows. I want to set the order of the "tabbing" with maybe a macro. Is this possible?-- Garyw |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Anne's code will work if you make changes to a cell in that array of addresses.
It work if you're just by tabbing. (F2 and hitting enter will be enough to fire the change event.) Garyw wrote: I can't get Anne's code to work. I've checked it several times. -- Garyw "Gord Dibben" wrote: In addition to what you find on Bob's site, here is event 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 This is sheet event code. Right-click on the sheet tab and "View Code". Copy/paste the above into that sheet module. Gord Dibben MS Excel MVP On Fri, 30 Mar 2007 08:18:02 -0700, Garyw wrote: I've create a form and I want to be able to tab through the the unlock cells in a certain order. Now when I hit the tab key it tabs from left to right by rows. I want to set the order of the "tabbing" with maybe a macro. Is this possible?-- Garyw -- Dave Peterson |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Typo probably
It "won't" work if you're just tabbing. Gord On Fri, 30 Mar 2007 14:32:22 -0500, Dave Peterson wrote: It work if you're just by tabbing. |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
The code does run if I press F2 and Enter.
I would prefer a one key tab but this will work fine. Thanks so much for your help. -- Garyw "Gord Dibben" wrote: Typo probably It "won't" work if you're just tabbing. Gord On Fri, 30 Mar 2007 14:32:22 -0500, Dave Peterson wrote: It work if you're just by tabbing. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
paste locked cells and unlocked cells in protected sheet | Excel Worksheet Functions | |||
Moving from unlocked cells to unlocked cells in an excel form | Excel Worksheet Functions | |||
Tabbing through Unlocked cells | Excel Worksheet Functions | |||
Tabbing between cells in Excel | Excel Discussion (Misc queries) | |||
Tabbing to move between cells | Excel Discussion (Misc queries) |