Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Tabbing in excel-use VBA
I was wondering if you can set tabs in excel to tab to unlocked cells only.
I can't find any information about this but it seems like it should be possible. I am not using a form, just a spreadsheet. But I have written alot of VBA code if there is a way to do it that way. ANy ideas. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Tabbing in excel-use VBA
That is the default behaviour in Excel with unlocked cells in a protected
worksheet. But only in left to right and top to bottom order. If your order is other that that....................... 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", "B10", "C5", "A10", "B1", "C3") 'adjust to suit '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 Sun, 18 Apr 2010 09:45:01 -0700, Phyllis wrote: I was wondering if you can set tabs in excel to tab to unlocked cells only. I can't find any information about this but it seems like it should be possible. I am not using a form, just a spreadsheet. But I have written alot of VBA code if there is a way to do it that way. ANy ideas. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Tabbing in excel-use VBA
Thank you. The tabbing code works great.
"Phyllis" wrote: I was wondering if you can set tabs in excel to tab to unlocked cells only. I can't find any information about this but it seems like it should be possible. I am not using a form, just a spreadsheet. But I have written alot of VBA code if there is a way to do it that way. ANy ideas. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel; tabbing through protected worksheet | Excel Discussion (Misc queries) | |||
Tabbing order in Excel form | Excel Discussion (Misc queries) | |||
Excel tabbing doesn't work | Excel Discussion (Misc queries) | |||
Tabbing in Excel | Excel Worksheet Functions | |||
Tabbing between cells in Excel | Excel Discussion (Misc queries) |