View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
OssieMac OssieMac is offline
external usenet poster
 
Posts: 2,510
Default Programmable Column Sequencing?

Hi,

I don't think there is any way of just setting a tab order on the worksheet
but if you are actually entering and/or changing data on the worksheet then
the following code will select the cell in the next required column on the
same row.

Not sure how savvy you are with VBA but to install the code, right click on
the worksheet tab name and select View Code. Copy the code and paste into the
VBA editor. Click the red cross at top right of VBA editor to close the
editor.

Just edit the case statements and the following line for the required order.
Add more case statements as required before the End Select line.

Private Sub Worksheet_Change(ByVal Target As Range)

Dim strCol As String

'Assign the column Alpha Id to variable
strCol = Split(Columns(Target.Column) _
.Address(, 0), ":")(1)

Select Case strCol
Case "A"
Cells(Target.Row, "D").Select

Case "B"
Cells(Target.Row, "E").Select

Case "C"
Cells(Target.Row, "K").Select

Case "AB"
Cells(Target.Row, "AZ").Select

End Select

End Sub

--
Regards,

OssieMac