+ Reply to Thread
Results 1 to 3 of 3

Cursor auto move from one cell to another

  1. #1
    Forum Contributor
    Join Date
    06-23-2005
    Posts
    253

    Cursor auto move from one cell to another

    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

  2. #2
    Jim Thomlinson
    Guest

    RE: 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
    >
    >


  3. #3
    Forum Contributor
    Join Date
    06-23-2005
    Posts
    253
    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, Mikeburg

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1