+ Reply to Thread
Results 1 to 2 of 2

Tab command

  1. #1
    Registered User
    Join Date
    09-22-2004
    Posts
    35

    Tab command

    Does anyone know if there a way to code a "tab" command such that no matter where the active cell is I can tab to the next immediate cell? Or do I have to specify which cell is the active cell? My macro moves the active cell around the page according to the contents of specific cells, but in some instances I will need the active cell to tab to the right without knowledge of what the coordinates of the active cell are.

  2. #2
    Registered User
    Join Date
    02-26-2005
    Posts
    8
    Yes, its possible. Use the Selection_Change event for the worksheet you're using. Keep track of the current cell the user is editing in a variable so that you know where they were last because when this event fires the target.address will be the cell that Excel moved the focus to after they pressed enter (which you don't care about). You can then pass the cell/range they were editing when they finished editing it and determine which cell/range you want to activate next based on whatever conditions. So if you stored this in a variable currentRange you can easily activate the new range using Range(currentRange).Activate.

    Using this methodology you will always know where the user was last.

+ 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