Message-ID: <480138567.8999.1711671342933.JavaMail.web05$@web05> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_8998_425002127.1711671342933" ------=_Part_8998_425002127.1711671342933 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
A DataValidation object rep=
resents a rule for validating data entered in cells. The rule may be applie=
d to a cell or a set of cells. The Workb=
ook class contains several CreateDataValidation methods for creating DataValidat=
ion
objects. To apply a DataValidation
object to a cell=
or group of cells, use Area.SetDataValidation or Range.SetDataValidation.
public sealed class DataValidation=20
Public NotInheritable Class DataValidation=20
ExcelApplication xlw =3D new ExcelApplication(); Workbook wb =3D xlw.Create(); //--- Create a data validation rule: DataValidation dv =3D wb.CreateDataValidation( DataValidation.ValidationType.WholeNumber, DataValidation.ComparisonType.Between, "=3D1", "=3D100"); String formula =3D "Sheet1!A2:F33 Sheet2!A5:D15"; //--- Apply the rule to a Range: wb.CreateRange(formula).SetDataValidation(dv);=20
Dim xlw As New ExcelApplication() Dim wb As Workbook =3D xlw.Create() '--- Create a data validation rule: Dim dv As DataValidation =3D wb.CreateDataValidation( _ DataValidation.ValidationType.WholeNumber, _ DataValidation.ComparisonType.Between, _ "=3D1", "=3D100") Dim formula As String =3D "Sheet1!A2:F33 Sheet2!A5:D15" '--- Apply the rule to a Range: wb.CreateRange(formula).SetDataValidation(dv)=20
Name | =20
Description | =20
---|---|
=20 | Returns the type of value that may be entered in= a cell. | =20
=20 | Returns the type of comparison that will be used= to validate a value entered in a cell with a data validation rule. | =20
=20 | Sets or returns the content of the error alert m= essage displayed when invalid data is entered in a cell. | =20
=20 | Sets or returns the style of error alert to disp= lay if error alerts are enabled. | =20
=20 | Sets or returns the title of the error alert dia= log that is displayed when invalid data is entered in a cell. | =20
=20 | Sets or returns whether the data validation rule= should ignore blank cells. | =20
=20 | Sets or returns the content of the input message= dialog that is displayed when the user selects a cell with a data validati= on rule. | =20
=20 | Sets or returns the minimum value that may be en= tered in a cell with a data validation rule. | =20
=20 | Sets or returns the maximum value that may be en= tered in a cell with a data validation rule. | =20
=20 | Sets or returns whether Excel should display an = error alert if invalid data is entered. | =20
=20 | Sets or returns whether to show a message when t= he user selects a cell to which a data validation rule applies. | =20
=20 | Sets or returns the title of the input message d= ialog that is displayed when the user selects a cell with a data validation= rule. | =20
=20 | Sets or returns whether a drop-down list will be= used to display valid values. | =20
Name | =20
Description | =20
---|---|
=20 | Sets all properties of the DataValidation object to an uninitialized state.=20 |
= =20 | Sets the allowed data type, comparison type, and= minimum value to use when validating a cell entry. | =20
SetAllowedType(ValidationType, ComparisonType, Object, Object)= p> | =20
Sets the allowed data type, comparison type, and= minimum and maximum values to use when validating a cell entry. | =20
=20 | Sets the allowed data type and a set of valid va= lues to use when validating a cell entry. | =20
Name | =20
Description | =20
---|---|
=20 | The type of comparison that will be used for val= idating the value of the cell. | =20
=20 | Type style of the icon in the error alert messag= e box. | =20
=20 | The data type allowed as the cell's value. | = =20