Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Controlling Entry Order on Unprotected Cells.

Controlling Entry Order on Unprotected Cells

Written by Allen Wyatt (last updated September 15, 2020)
This tip applies to Excel 97, 2000, 2002, and 2003


Rob has a number of worksheets that are used to score assessments. The first worksheet has cells for name, date, etc., then several columns to enter the multiple-choice responses. The sheet is protected, so only input cells can be changed. When the user finishes the last cell in a column, the focus will jump to the next unprotected cell, which may be the first cell in the next column, or it might be the "date" cell. Rob wonders how he can control the focus so that when the value is entered into the last (bottom) cell in a column, it will then move to a cell that he specifies.

There is no built-in way to do this in Excel, as the program determines its own order of choosing which cell is next selected. You can modify which cell is selected next when you press Enter in a worksheet, but you cannot modify what happens when you press Tab in a protected worksheet. By default cells are selected left to right and then top to bottom in the worksheet.

If you want to modify what happens when the Tab key is pressed, then you'll need to resort to using a macro to control the selection order. The following macro is an example; it moves to cell D5 when leaving cell C10 and to E5 when leaving cell D10:

Private Sub Worksheet_Change(ByVal Target As Range)
    Application.EnableEvents = False
    If Target.Address = "$C$10" Then Range("D5").Select
    If Target.Address = "$D$10" Then Range("E5").Select
    Application.EnableEvents = True
End Sub

The problem with using a VBA solution like this is that it can make your spreadsheet—particularly if it is a large one—a bit more sluggish. By their nature, macros also mean that the Undo feature is disabled.

If your tab order needs are more complex, then you may be interested in the code discussed at this web page:

http://www.ozgrid.com/forum/showthread.php?t=82272

As you can tell, the code can get rather complex at times. Of course, such an approach, since it stipulates all cell-to-cell movement, makes it more difficult to make changes to the design of the worksheet itself.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (10313) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Controlling Entry Order on Unprotected Cells.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Duplex by Default

Many printers these days have the capability to print on both sides of a piece of paper. You may want Word to use this ...

Discover More

Editing a Hyperlink

Excel will cheerfully keep track of all sorts of hyperlinks for you. If you want to change the hyperlink in some way, ...

Discover More

Backing Up Quick Access Toolbars

The Quick Access Toolbar is a place where you can easily put your customizations. If you want to back up that toolbar ...

Discover More

Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!

More ExcelTips (menu)

Hiding and Protecting Columns

Want to hide certain columns within a worksheet so the contents are not visible to others? The answer lies in formatting ...

Discover More

Inserting and Deleting Rows in a Protected Worksheet

You've protected and saved your worksheet with explicit instructions that you be allowed to insert and delete rows. But ...

Discover More

Functioning Check Boxes in a Protected Worksheet

Want to protect a worksheet but maintain the ability to make changes to the check boxes you add to the worksheet? Here is ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is three more than 1?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.