Imran said:
Dear
I want to solve the problem that i m facing in MS-Excel
Q.
For example, I am currently in A1, i want to go to E1 by pressing single
Tab. At the same time, i should be able to edit the cell in columns B,C and D.
One way:
Put this in your ThisWorkbook Code Module (CTRL-click the workbook
header and choose View Code - delete any automatically inserted code):
Private Sub Workbook_Open()
Application.OnKey "{TAB}", "AtoE"
End Sub
Put this in a regular code module (while in the Visual Basic Editor,
choose Insert/Module):
Public Sub AtoE()
If TypeOf Selection Is Range Then
With ActiveCell
If .Column = 1 Then
.Offset(0, 4).Activate
Else
If .Column <> .Parent.Columns.Count Then _
.Offset(0, 1).Activate
End If
End With
End If
End Sub
Note: This will not act like the regular tab key in a multiple cell
selection, where upon reaching the right edge of the selection, tab
moves to the left side of the selection and down a row. The code isn't
hard to write, but I'll leave it as an exercise.
Note2: In order to activate the OnKey setting, close and reopen the
workbook.