How to set formulas in cells using Apache POI?

后端 未结 7 1668
慢半拍i
慢半拍i 2021-01-01 09:09

I am currently using Apache POI for Java to set formulas in cells.

But after I run the program and open the Excel file that I created and processed, the cells with t

7条回答
  •  无人及你
    2021-01-01 09:17

    The below code worked fine for me, hope this could be useful to someone.

    cell.setCellType(Cell.CELL_TYPE_FORMULA);
    cell.setCellFormula("SUM(C70:C76)");
    

提交回复
热议问题