Create a drop-down list of possible input values


If you're creating a worksheet that will require user input and you want to minimise data entry errors, use Excel's data validation feature to add a drop-down list. The best part about it is that you don't have to write any macros.

û Phil Schmaltz

Data validation, which debuted in Excel 97, is an excellent way to ensure that a cell entry is of the proper data type (text, number, or date) and within the proper numeric range. The drop-down list produced with the feature appears when a user clicks the cell.

Caption: A drop-down list of valid entries for an input field minimises data entry errors in Excel 97

Here's how to create a drop-down list:

1. Type the list of valid entries in a single column. If you like, you can hide this column (select FormatûColumnûHide).

2. Select the cell or cells that will display the list of entries.

3. Choose DataûValidation, and select the Settings tab.

4. From the Allow drop-down list, select List.

5. In the Source box, enter a range address or a reference to the items that you entered in Step 1.

6. Make sure the In-cell dropdown box is selected.

7. Click OK.

If your list is short, you can skip Step 1 and type the list entries directly in the Source box in Step 5, separating items with a comma.

The Data Validation dialogue box has two other tabs. Click Input Message to add a prompt that will appear when a user selects a cell. Click Error Alert to specify a custom error message if the user's entry is invalid.

The handy data validation feature suffers from one serious flaw. If you paste an entry into a cell that uses data validation, the validation isn't performed. And if you select that cell again, the drop-down list no longer appears. Fortunately, you can circumvent this problem by protecting the worksheet ù select ToolsûProtectionûProtect Sheet.

û John Walkenbach


Category:spreadsheet
Issue: November 1998

These Web pages are produced by Australian PC World © 1998 IDG Communications