awaitExcel.run(async(context) => {letsheet = context.workbook.worksheets.getActiveWorksheet();letrange = sheet.getRange("B2:C5"); range.dataValidation.rule = {date: {formula1:"2022-04-01",formula2:"2022-04-08",
DataSeries 方法:在指定区域内创建数据系列。 DataTypeToText 方法:如果区域中的任何单元格是已链接数据类型(例如股票或地理位置),则此调用会将其值转换为文本。如果区域中的单元格均_不是_已链接数据类型,则调用会失败。 Delete 方法:删除对象,参数shift可选,仅与**Range** 对象一起使用。 指定如何移动单元格来...
Get users to enter accurate, appropriate, and orderly information into your worksheets with Excel’s data validation feature.
Data validation is beneficial for controlling data input into your worksheet. Learn the optimal setup, limitations, and how to expand data preparation capabilities.
date range: Jan 1, 2024 to Dec 31, 2024validation.Formula1 = "2024-01-01";validation.Formula2 = "2024-12-31";// Set the error message to display when the date is out of rangevalidation.ErrorMessage = "Date must be within the year 2024.";// Enable showing the error alertvalidation...
string | Date | Excel.Range 注解 [ API 集:ExcelApi 1.8 ]operator 用于验证数据有效性的运算符。 TypeScript 复制 operator: Excel.DataValidationOperator | "Between" | "NotBetween" | "EqualTo" | "NotEqualTo" | "GreaterThan" | "LessThan" | "GreaterThanOrEqualTo" | "LessThanOrEqualTo...
{ formula1:0, operator: Excel.DataValidationOperator.greaterThan } }; rankingRange.dataValidation.rule = greaterThanZeroRule; rankingRange.dataValidation.prompt = { message:"Please enter a positive number.", showPrompt:true, title:"Positive numbers only."}; rankingRange.dataValidation.errorAlert ...
CellRange rangeDate= sheet.getCellRange("B6"); rangeDate.getDataValidation().setAllowType(CellDataType.Date); rangeDate.getDataValidation().setCompareOperator(ValidationComparisonOperator.Between); rangeDate.getDataValidation().setFormula1("1/1/1970"); ...
If you allow Text length, you can set or exclude a range of lengths, or specify a minimum number or maximum length. Type the textlength into the Data Validation dialog box OR, Refer to cells that contain a value on the worksheet
setText("请输入1/1/1970-12/31/1970之间的日期:"); CellRange rangeDate = sheet.getCellRange("B6"); rangeDate.getDataValidation().setAllowType(CellDataType.Date); rangeDate.getDataValidation().setCompareOperator(ValidationComparisonOperator.Between); rangeDate.getDataValidation().setFormula1("1/1...