Create a drop-down list

更新时间:2023-07-21 16:00:01 阅读量: 实用文档 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

Create a drop-down list Show All

To make data entry easier, or to limit entries to certain items that you define, you can create a drop-down list that

gets its choices from cells elsewhere on the worksheet.

Type the entries for the drop-down list in a single column or row. Do not include blank cells in the list.

If you type the list on a different worksheet from the data entry cell, define a name (name: A word or string of characters that represents a cell, range of cells, formula, or constant value. Use easy-to-understand names, such as Products, to refer to hard to understand ranges, such as Sales!C20:C30.) for the list.

Select the cell, range of cells, or nonadjacent selections (nonadjacent selection: A selection of two or more cells or ranges that don't touch each other. When plotting nonadjacent selections in a chart, make sure that the combined selections form a rectangular shape.) that you want to name.

Click the Name box at the left end of the formula bar (formula bar: A bar at the top of the Excel window that you use to enter or edit values or formulas in cells or charts. Displays the constant value or formula stored in the active cell.)

.

Name box

Type the name for the cells.

Press ENTER.

Note You cannot name a cell while you are changing the contents of the cell.

If you type the list in a different workbook, define a name with an external reference to the list.

Open the workbook that contains the list of drop-down entries.

Open the workbook where you want to validate cells, point to Name on the Insert menu, and then click Define.

In the Names in workbook box, type the name.

In the Refers to box, delete the contents, and keep the insertion pointer in the box.

On the Window menu, click the name of the workbook that contains the list of drop-down entries, and then click the worksheet that contains the list.

Select the cells containing the list.

In the Define Name dialog box, click Add, and then click Close.

Select the cell where you want the drop-down list.

1.

2.

3. On the Data menu, click Validation, and then click the Settings tab. In the Allow box, click List. If the list is in the same worksheet, enter a reference to your list in the Source box.

If the list is elsewhere, enter the name you defined for your list in the Source box.

Make sure the reference or name is preceded with an equal sign (=).

4.

5.

6. Make sure the In-cell drop-down check box is selected. Specify whether the cell can be left blank: Select or clear the Ignore blank check box. To display optional input instructions when the cell is clicked, click the Input Message tab, make sure the

Show input message when cell is selected check box is selected, and then fill in the title and text for the message.

7. Specify how you want Microsoft Excel to respond when invalid data is entered.

Click the Error Alert tab, and make sure the Show error alert after invalid data is entered check box is selected.

Select one of the following options for the Style box:

To display an information message that does not prevent entry of invalid data, click Information.To display a warning message that does not prevent entry of invalid data, click Warning.To prevent entry of invalid data, click Stop.

Fill in the title and text for the message (up to 225 characters).

Note If you don't enter a title or text, the title defaults to " Microsoft Excel" and the message to: "The value you entered is not valid. A user has restricted values that can be entered into this cell."

Notes

Applying data validation to a cell does not format the cell. A drop-down list you create for a cell will be represented by an arrow next to that

cell . To enter information in that cell, click the arrow, and then click the entry you want. To make entering of repeated data easier, Excel automatically generates a drop-down list of all the unique

items in a column. This drop-down list is not attached to a specific cell, nor is it represented by an arrow. To select information from this drop-down list, right-click the cell directly above or below other entries in a column, and then click Pick From Drop-down List.

Tip

If the entry list is short, you can type the entries directly in the Source box, separated by the Microsoft Windows list separator character (commas by default). For example, you could type Low, Average, High in the Source box instead of entering the three words on a worksheet.

本文来源:https://www.bwwdw.com/article/wgym.html

Top