Replied 8 September 2017, 3:17 pm EST
thank you. it really helps.
and now I try to make it specific functions using it.
but, it little bit hard for me.
I want same functions like MS Excel drag and fill formula, not the copy the formula.
if I declare the formula like "=sum(a1:b1)" at "c1" cell, and then drag down this cell to "c2",
it would be automatically changed like "=sum(a2,b2)" at "c2" cell.
could give me more hint for this function?
I really thank you for your service, Ankita.</blockquote>
It is actually possible to implement code to do that pretty easily.
You just need to use the GetExpression
methods instead of GetFormula
; for example:
fpSpread.Sheets.SetExpression(2, 0, fpSpread.Sheets.GetExpression(1, 0));
When the formula is set to the cell, and it uses relative cell references
(as your example formulas do -- e.g. "A1" is relative while "$A$1" is absolute), then the parsed Expression will contain a CellExpression
with RowRelative/ColumnRelative = true, so that when the Expression is moved, those relative references will move with the expression.
Hope that helps and is clear enough!