18.11.2014 Views

Microsoft Office

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Using Data Validation 25<br />

7. (Optional.) Click the Error Alert tab and specify which error message to display when a<br />

user makes an invalid entry. The selection for Style determines what choices users have when<br />

they make invalid entries. To prevent an invalid entry, choose Stop. If this step is omitted, a standard<br />

message will appear if the user makes an invalid entry.<br />

8. Click OK.<br />

After you’ve performed these steps, the cell or range contains the validation criteria you specified.<br />

Types of Validation Criteria You Can Apply<br />

The Settings tab of the Data Validation dialog box enables you to specify a wide variety of data validation<br />

criteria. The following options are available in the Allow drop-down box. Keep in mind that the other controls<br />

in the Settings tab vary, depending on your choice in the Allow drop-down box.<br />

n<br />

n<br />

n<br />

n<br />

n<br />

n<br />

n<br />

n<br />

Any Value: Selecting this option removes any existing data validation. Note, however, that the<br />

input message, if any, still displays if the check box is checked in the Input Message tab.<br />

Whole Number: The user must enter a whole number. You specify a valid range of whole numbers<br />

by using the Data drop-down list. For example, you can specify that the entry must be a<br />

whole number greater than or equal to 100.<br />

Decimal: The user must enter a number. You specify a valid range of numbers by using the Data<br />

drop-down list. For example, you can specify that the entry must be greater than or equal to 0<br />

and less than or equal to 1.<br />

List: The user must choose from a list of entries you provide. This option is very useful, and I<br />

discuss it in detail later in this chapter (see “Creating a drop-down list”).<br />

Date: The user must enter a date. You specify a valid date range by using the Data drop-down list.<br />

For example, you can specify that the entered data must be greater than or equal to January 1,<br />

2007, and less than or equal to December 31, 2007.<br />

Time: The user must enter a time. You specify a valid time range by using the Data drop-down<br />

list. For example, you can specify that the entered data must be greater than 12:00 p.m.<br />

Text Length: The length of the data (number of characters) is limited. You specify a valid length<br />

by using the Data drop-down list. For example, you can specify that the length of the entered data<br />

be 1 (a single alphanumeric character).<br />

Custom: To use this option, you must supply a logical formula that determines the validity of the<br />

user’s entry (a logical formula returns either True or False). You can enter the formula directly<br />

into the Formula control (which appears when you select the Custom option), or you can specify<br />

a cell reference that contains a formula. This chapter contains examples of useful formulas.<br />

The Settings tab of the Data Validation dialog box contains two other check boxes:<br />

n<br />

n<br />

Ignore Blank: If checked, blank entries are allowed.<br />

Apply These Changes to All Other Cells with the Same Setting: If checked, the changes you<br />

make apply to all other cells that contain the original data validation criteria.<br />

It’s important to understand that, even with data validation in effect, the user can enter invalid data. If the<br />

Style setting in the Error Alert tab of the Data Validation dialog box is set to anything except Stop, invalid<br />

data can be entered. Also, remember that data validation does not apply to the calculated results of formulas.<br />

In other words, if the cell contains a formula, applying conditional formatting to that cell will have no<br />

effect.<br />

483

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!