0

我想要两个单元格值之间的单元格值。我使用 HSSFDataValidation 对 apache poi 创建的 excel 文件进行设置验证,但执行时出错。

源代码:

HSSFDataValidationHelper dvHelper = new HSSFDataValidationHelper(sheet);
DVConstraint dvConstraint =(DVConstraint) dvHelper.createNumericConstraint
             (DataValidationConstraint.ValidationType.DECIMAL,
              DataValidationConstraint.OperatorType.BETWEEN,
              "G3", 
              "H3");
CellRangeAddressList  addressList=new CellRangeAddressList (2,rowNum,8,8);
DataValidation validation =dvHelper.createValidation(dvConstraint, addressList);
validation.setSuppressDropDownArrow(false);
validation.setShowErrorBox(true);
sheet.addValidationData(validation);

错误 :

The supplied text 'G3' could not be parsed as a number 
4

1 回答 1

0

将此格式用于公式: "=$G$3""=$H$3"

于 2017-05-13T12:50:18.010 回答