简体   繁体   English

如何检查Excel单元格文本是否包含Excel公式

[英]How to check excel cell text contain excel formula or not

I am validating individual cell content of excel. 我正在验证Excel的单个单元格内容。 For reading an excel I am using apache POI. 为了阅读Excel,我正在使用apache POI。 I want to put validation on formulas text , is there any way that I can check if particular text/String contain excel formula or not using java? 我想对公式文本进行验证,有什么方法可以检查特定的文本/字符串是否包含excel公式或不使用java?

please suggest some regex or pattern 请提出一些正则表达式或模式

If you are using the POI dependencies, you can simply check the type of your cell using: 如果您使用的是POI依赖关系,则可以使用以下命令简单地检查单元格的类型:

if(yourCell!=null && yourCell.getCellType()== Cell.CELL_TYPE_FORMULA){
    //....
     }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM