Create or remove a drop-down list
- To create a list of valid entries for the drop-down list, type the entries in a single column or row without blank cells. For example:
A | |
---|---|
1 | Sales |
2 | Finance |
3 | R&D |
4 | IT |
Note You may want to sort the data in the order that you want it to appear in the drop-down list.
- If you want to use another worksheet, type the list on that worksheet, and then define a name for the list.
How?
- 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.).
- Type the name for the cells, for example, ValidDepts.
- Press ENTER.
Note You cannot name a cell while you are changing the contents of the cell.
- Select the cell where you want the drop-down list.
- On the Data tab, in the Data Tools group, click Data Validation.
An Excel table may be linked to a SharePoint site You cannot add data validation to an Excel table that is linked to a SharePoint site. To add data validation, you must unlink the Excel table or convert the Excel table to a range of data. For more information about how to convert an Excel table to a range of data, see Delete a table without losing the data or table formatting.
You may be currently entering data The Data Validation command is not available on the Data tab while you are entering data in a cell. To finish entering, press ENTER or ESC.
The worksheet might be protected or shared You cannot change data validation settings if your workbook is shared or protected.
- In the Data Validation dialog box, click the Settings tab.
- In the Allow box, click List.
- To specify the location of the list of valid entries, do one of the following:
- If the list is in the current worksheet, enter a reference to your list in the Source box or click in the Source box and then select your list in the current spreadsheet to populate the reference automatically.
- If the list is on a different worksheet, enter the name that you defined for your list in the Source box.
In both cases, make sure that the reference or name is preceded with an equal sign (=). For example, enter =ValidDepts.
- Make sure that the In-cell dropdown check box is selected.
- To specify whether the cell can be left blank, select or clear the Ignore blank check box.
- Optionally, display an input message when the cell is clicked.
How to display an input message
- Click the Input Message tab.
- Make sure that the Show input message when cell is selected check box is selected.
- Type the title and text for the message (up to 225 characters).
- Specify how you want Excel to respond when invalid data is entered, by doing the following:
- Click the Error Alert tab, and make sure that 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.
- Type 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 - To delete a drop down list, select the cell with the list. Click the Data tab, and then in the Data Group, click Data Validation. In the Data Validation dialog box, click the Settings tab, and then click Clear All. Learn more about removing data validation.
- The width of the drop-down list is determined by the width of the cell that has the data validation. You may need to adjust the width of that cell to prevent truncating the width of valid entries that are wider than the width of the drop-down list.
- The maximum number of entries that you can have in a drop-down list is 32,767.
- If the validation list is on another worksheet and you want to prevent users from seeing it or making changes, consider hiding and protecting that worksheet. For more information about how to protect a worksheet, see Protect worksheet or workbook elements.