ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Cursor auto move from one cell to another (https://www.excelbanter.com/excel-programming/338473-cursor-auto-move-one-cell-another.html)

mikeburg[_19_]

Cursor auto move from one cell to another
 

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

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

Thanks all,

mikebur

--
mikebur
-----------------------------------------------------------------------
mikeburg's Profile: http://www.excelforum.com/member.php...fo&userid=2458
View this thread: http://www.excelforum.com/showthread.php?threadid=39956


Jim Thomlinson[_4_]

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



mikeburg[_20_]

Cursor auto move from one cell to another
 

Thanks for your help. There are two problems with the code.
(1) After entering data in cell A14, cursor changes to column B and
(2) I Can't use the arrow key to go back to the data in B8 & before.

Please help, Mikebur

--
mikebur
-----------------------------------------------------------------------
mikeburg's Profile: http://www.excelforum.com/member.php...fo&userid=2458
View this thread: http://www.excelforum.com/showthread.php?threadid=39956



All times are GMT +1. The time now is 01:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com