Select the range. Click the Data tab. Click the Data Validation button.
![Click the Data tab. Click the Data Validation button.](http://www.java2s.com/Tutorial/Microsoft-Office-Excel-2007Images/Create_Validation_Rules___Click_Data_Tab_Click_Data_Validatio.PNG)
Click the Settings tab.
Click the Allow list arrow, and then select a value type.
![Click the Allow list arrow, and then select a value type.](http://www.java2s.com/Tutorial/Microsoft-Office-Excel-2007Images/Create_Validation_Rules___Click_Allow_List_Arrow_And_Then_Sel.PNG)
Click the Data list arrow, and then select a logical operator.
![Click the Data list arrow, and then select a logical operator.](http://www.java2s.com/Tutorial/Microsoft-Office-Excel-2007Images/Create_Validation_Rules___Click_Data_List_Arrow_And_Then_Sele.PNG)
Enter values or use Collapse Dialog button to select a range for the minimum and maximum criteria.
![Enter values or use Collapse Dialog button to select a range for the minimum and maximum criteria.](http://www.java2s.com/Tutorial/Microsoft-Office-Excel-2007Images/Create_Validation_Rules___Enter_Values_Or_Use_Collapse_Dialog.PNG)
Click the Input Message tab,
and then type a title and the input message that should be displayed when invalid entries are made.
![Click the Input Message tab, and then type a title and the input message that should be displayed when invalid entries are made.](http://www.java2s.com/Tutorial/Microsoft-Office-Excel-2007Images/Create_Validation_Rules___Click_Input_Message_Tab_And_Then_Ty.PNG)
Click the Error Alert tab,
and then select an alert style, type a title, and error message.
![Click the Error Alert tab, and then select an alert style, type a title, and error message.](http://www.java2s.com/Tutorial/Microsoft-Office-Excel-2007Images/Create_Validation_Rules___Click_Error_Alert_Tab_And_Then_Sele.PNG)
Click OK.
![Click OK.](http://www.java2s.com/Tutorial/Microsoft-Office-Excel-2007Images/Create_Validation_Rules___Click_Ok.PNG)