First off, for future questions you might ask in these newsgroups... tell us
you are using XL2007 when you post your question (it could make a difference
in the answer you will need).
Okay, I fired up my copy of XL2007 and what I posted works there (as I would
have expected), so lets see if we can get you up to speed on how to use what
I posted. If you don't already have it running, start up your copy of XL2007
and go to a blank worksheet. Just to repeat, right-click the tab at the
bottom of the worksheet (the tab will probably have SheetX as its caption
where X is a number), select View Code from the popup menu that appears and
copy/paste this code (don't change it) into the window that came up inside
the VBA editor...
Private Sub Worksheet_Change(ByVal Target As Range)
Const Addr = "D1 G10 A5 B7 C3"
With Target
If InStr(" " & Addr & " ", " " & .Address(False, False) & " ") Then
If .Address(False, False) <> Mid$(Addr, InStrRev(Addr, " ") + 1) Then
Range(Split(Split(Addr & " " & .Address(False, False), _
.Address(False, False) & " ")(1))(0)).Select
End If
End If
End With
End Sub
Now, go back to the worksheet whose tab you clicked in order to copy/paste
the code above. Click into cell D1. Type something and then press the Enter
key. G10 should have automatically become the active cell. Type something
into it and press the Enter key. Now A5 should have automatically become the
active cell. Type something into it and this time press the Tab key. Now B7
should have become the active cell. Do this once more and you should be in
cell C3. Since this the last cell in the list assigned to the Const Addr
statement, typing something in it and pressing Enter or Tab will move the
active cell highlight in whatever direction your option is set for. This
option can be found by clicking the Office button (the large round circle
icon in the upper left corner), clicking the Excel Options button at the
bottom right corner of the dialog box that came up, clicking Advanced in the
listing on the left of the options' dialog box and looking at the first item
in the "Editing options" section in the panel on the right.
Rick
Rick,
Sorry, but I'm using Excel 2007 and I don't have a Tools menu...
Otherwise, I followed your instructions and inserted the code, but it
didn't seem to do anything at all... Am I missing a step? Sorry, but
you may have to dumb-it-down even further for me.
Many thanks,
Craig