Moving with in an EXCEL program

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do I move or jump from one cell to another avoiding other cells in
between. Example If I was in cell A1 and want to go to cell D6 next the go to
G8 the return turn to A2, how could I do this.
 
Try this code, go to the sheet you require this to work on, right click on
the sheet tab and select view code, paste the following in that window.

Private Sub Worksheet_Change(ByVal Target As Range)

Dim aTabOrd As Variant
Dim i As Long

aTabOrd = Array("A1", "D6", "G8", "A2")

For i = LBound(aTabOrd) To UBound(aTabOrd)
If aTabOrd(i) = Target.Address(0, 0) Then
If i = UBound(aTabOrd) Then
Me.Range(aTabOrd(LBound(aTabOrd))).Select
Else
Me.Range(aTabOrd(i + 1)).Select
End If
End If
Next i

End Sub
 
Hi,

First click cell A1, and then press the Ctrl key and click D6, G8 and A2 and
then release the Ctrl key.

Important: Do not press your mouse cursor. Just press the enter key. You
will notice cell selection moves across all the cells within the range.

Challa Prabhu
 
Back
Top