Setting focus to specific cells

  • Thread starter Thread starter Lluis Escude
  • Start date Start date
L

Lluis Escude

I want the focus to be automatically placed on a specific
cell when the current cell is left, e.g. I'm in b16 and
when I hit the tab or the enter key I want the cursor to
be at, say, d23. How can I write a macro for that?
 
Hi

A quote:
Tom Ogilvy said:
select your cells in the order you desire, starting with the second cell in
the sequence and ending with the first. Hold the control key down while you
do this to expand the selection.

Then go to the name box in the upper left corner and enter

Order1

and hit return

This names the select range Order1 (use any legal name you want).


If you use just the tab key, you will tab through the range in the same
order you selected the cells. Any time you need to do this, select the
defined name from the name box dropdown.


Arvi Laanemets
 
How can I write a macro for that?

You can if you like, but there's no need. You can define a named range if
your input cells and tab thru that.

Say your input cells are A1, C1 and E1. Holding down CTRL, click on C1 then
E1 then A1 (so you must select them in entry order, except that the first
cell must be selected last). Click in the Name Box (left of formula bar),
then type eg: "Input" (w/out the quotes), then press Enter. Then you can
select the range via the Name Box and tab or Enter thru.

Rgds,
Andy
 
Now, how about doing the same thing when the Enter
(Return) key is hit?

Works the same for tab and both Enters on my k/b. Did you try it?

Also, you wanna be careful mentioning S*ndK*ys round these parts, you'll
annoy the gurus.

Rgds,
Andy
 
Back
Top