excel
excel copied to clipboard
How to set CellType.Formula into cell
i try to set cell with fomula like '=Sum(A1:A10)' but seem it not working. only text inside and cannot calculate data in sum column. i see CellType.Formula but don't have any suggestion for using this
any news ??
To anyone who stumbled upon this like me. (Using the Prerelease: 2.0.0-null-safety-3)
Found it after some trial & error - It is actually quite simpel:
Sheet sheetObject = excel['Sheet1'];
final cellIndex = CellIndex.indexByColumnRow(
columnIndex: 0,
rowIndex: 0,
);
sheetObject.updateCell(cellIndex, Formula.custom('YOUR_FORMULA'));
Hope that helps for future reference.