View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_4_] Jim Thomlinson[_4_] is offline
external usenet poster
 
Posts: 1,119
Default Cursor auto move from one cell to another

So just to clarify when the the user leaves Cell B9 you want the cursor to go
to cell A14. Assuming that to be the case add this code to the
Selection_Change event for the sheet (Right click on the tab that you want to
have this behavior - Select View Code. Just above the code window is a drop
down box with the word (General) in it. Change it to worksheet. When you do
this a procedure will be added to the Code window. This is the selection
change procedure which will fire whenever the cursor is moved.)

Private Sub Selection_Change(Target as Range)
on error goto ErrorHandler
application.enableevents = false
if target.address = "$B$9" then range("A14").select
ErrorHandler:
application.enableevents = true
end sub


--
HTH...

Jim Thomlinson


"mikeburg" wrote:


Using VBA how can I have my cursor automatically move from cell C9 to
cell A14 after hitting the enter key in cell B9? (note, there may be
data entered or else it may be left blank)

Then after enter data in A14, cursor movement go back to normal from
A14 (either right or down depending on the user settings).

Thanks all,

mikeburg


--
mikeburg
------------------------------------------------------------------------
mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581
View this thread: http://www.excelforum.com/showthread...hreadid=399569