Excel has "events" that you can use to trigger VBA code execution.
One "event" is called SelectionChange.
If you right-click on the sheet "tab" and select "View Code" it will open the 
VBA editor.

paste this into the editor window:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Target.Address = "$A$2" Then Range("A1").Select
End Sub


this macro is triggered whenever a cell on the sheet is selected.
the range selected is passed to the macro as "target"

the macro tests to see if the address of the selected cell is A2.
if it is, then it selects cell A1
(note, this will THEN call this routine once again, but since the new cell: 
"A1" 
is not "A2", nothing happens)

hope this helps,

Paul




________________________________
From: Norman May <nor...@gmail.com>
To: excel-macros@googlegroups.com
Sent: Tue, January 26, 2010 5:13:05 AM
Subject: Re: $$Excel-Macros$$ how to keep cursor in current field after enter.


In Excel 2003 go to Tools/Options/Edit then remove the check mark from "Move 
selection after enter".

Norman

On Mon, Jan 25, 2010 at 6:38 PM, Wilbur Kush <ocwil...@gmail.com> wrote:


>
>I have a scale that inputs data into excel via rskey, a keyboard
>emulator that comes with the scale. No problems getting the data into
>excel from the scale, however, a carriage return (enter) is sent after
>the weight is entered into field A1.  This sends the cursor to A2
>after entering the weight into A1. I am trying to get excel to move
>the cursor back to A1 after the carriage return so I can update the
>weight when needed. Can Excel be told to move the cursor to A1 when it
>arrives at A2 ?
>
>I am a total noobie to excel, so I apologize if I am not using the
>proper terms. I searched the forums to no avail. I think my lack of
>experience with excel's terms might be the problem. Everything else
>works great and I think if I can get this one issue resolved, It
>should work.
>
>Any input is appreciated.
>
>
>Wilbur
>
>--
>----------------------------------------------------------------------------------
>Some important links for excel users:
>1. Follow us on TWITTER for tips tricks and links : 
>http://twitter.com/exceldailytip
>2. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
>http://www.excelitems.com/
>3. Excel tutorials at http://www.excel-macros.blogspot.com/
>4. Learn VBA Macros at http://www.quickvba.blogspot.com/
>5. Excel Tips and Tricks at http://exceldailytip.blogspot.com/
>
>
>To post to this group, send email to excel-macros@googlegroups.com
>If you find any spam message in the group, please send an email to:
>Ayush Jain  @ jainayus...@gmail.com
><><><><><><><><><><><><><><><><><><><><><><>
>HELP US GROW !!
>
>We reach over 6,700 subscribers worldwide and receive many nice notes about 
>the learning and support from the group.Let friends and co-workers know they 
>can subscribe to group at http://groups.google.com/group/excel-macros/subscribe
>
-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com

 
To post to this group, send email to excel-macros@googlegroups.com
If you find any spam message in the group, please send an email to:
Ayush Jain @ jainayus...@gmail.com
<><><><><><><><><><><><><><><><><><><><><><>
HELP US GROW !!
 
We reach over 6,700 subscribers worldwide and receive many nice notes about the 
learning and support from the group.Let friends and co-workers know they can 
subscribe to group at http://groups.google.com/group/excel-macros/subscribe

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 

To post to this group, send email to excel-macros@googlegroups.com
If you find any spam message in the group, please send an email to:
Ayush Jain  @ jainayus...@gmail.com
<><><><><><><><><><><><><><><><><><><><><><>
HELP US GROW !!

We reach over 6,700 subscribers worldwide and receive many nice notes about the 
learning and support from the group.Let friends and co-workers know they can 
subscribe to group at http://groups.google.com/group/excel-macros/subscribe

Reply via email to