I'm having trouble here. I have a worksheet that I want to set up so I can tab the cell focus in a particular order.
I need the macro to run once then stop so I can enter data in cells not on the list if necessary. I also need to be able to start and stop the nacro with buttons. I don't particularly need the macro to remember where it stopped so it can begin there again but it would be handy.
I have found a macro that sets cell focus based on a list, but drops out if you don't make an entry in the cell (I'd like to be able to tab by a cell if the value hasn't changed)
Private Sub Worksheet_Change(ByVal Target As Range)
Dim aTabOrd As Variant
Dim i As Long
'Set the tab order of input cells
aTabOrd = Array("A5", "A10", "B5", "B10", "C5", "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
Is there a way to keep this from dropping out without a button command?
I there a way to make this a macro that gets called by the sheet when activated? I'd like to get the cell list on a separate sheet so I don't have to change a bunch of sheets if I need to change the cell list and I can't do that with a sheet routine as it won't work with a list off the page.
I've been looking at this so long with different macros for determining the tab list I'm just not coming up with any good ideas
Bookmarks