# Delete Validation

DsExcel Java is a MESCIUS Documents product that offers a comprehensive library to create, manipulate, convert, and share Microsoft Excel-compatible spreadsheets.

## Content





You can delete an existing validation rule applied to a cells or range of cells in a worksheet using the [delete](/document-solutions/java-excel-api/api/online/com/grapecity/documents/excel/IValidation.html#delete) method of the [IValidation](/document-solutions/java-excel-api/api/online/com/grapecity/documents/excel/IValidation.html) interface.

You can use the following example code to delete an existing validation rule which was previously applied to a cell or a range of cells in a worksheet.

```Java
Calendar time1 = new GregorianCalendar(1899, 11, 30, 13, 30, 0);
Calendar time2 = new GregorianCalendar(1899, 11, 30, 18, 30, 0);
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("hh:mm:ss");
        
// Add Validation
worksheet.getRange("A1:A2").getValidation().add(ValidationType.Date, ValidationAlertStyle.Stop,
        ValidationOperator.Between, simpleDateFormat.format(time1.getTime()),
        simpleDateFormat.format(time2.getTime()));
// Delete validation.
worksheet.getRange("A1:A2").getValidation().delete();
```