Apply Formula to a Range

Hi

I want to set the same formula (in relative way) for a range.
Example:

A1 = 2 | B1 = 4 | C1 = A1 + B1
A2 = 3 | B2 = 3 | C2 = A2 + B2
A3 = 5 | B3 = 9 | C3 = A3 + B3


Do I need set the formula in code for C1, C2, C3, … for each cell (iterate to all cells and do cell.Formula = “myformula”) or is it possible to set somehow the formula for a range/area?

Thanks for your help
Giuseppe

Hi Giuseppe,

I think you may use Cell.SetSharedFormula() method for your need. See the document for your reference:
http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/setting-shared-formula.html

Thank you.


Ecactly what I was looking for.

Thanks for your support.
It’s extreme fun develop with aspose cells!

Regards,
Giuseppe