Column calculation

Is it possible to set the Formula in the First Say column "= SUM (A1: A10)" and then display the value in cells from A1 to A10 and then perform the calculation.

+4
source share
2 answers

Yes, I get an answer. By doing some RNDs, I realized that the Furmula operation does not work with :

SpreadsheetGear.IRange range = WorkBookViewForData.ActiveWorksheet.Cells["A10"]; range.Formula = "=SUM(A1:A9)" SpreadsheetGear.IRange range1 = WorkBookViewForData.ActiveWorksheet.Cells["A1"]; range1.value = "1" SpreadsheetGear.IRange range2 = WorkBookViewForData.ActiveWorksheet.Cells["A2"]; range2.value = "2" SpreadsheetGear.IRange range3 = WorkBookViewForData.ActiveWorksheet.Cells["A3"]; range3.value = "3" 

But works with

  SpreadsheetGear.IRange range = WorkBookViewForData.ActiveWorksheet.Cells["A10"]; range.Formula = "=SUM(A1:A9)" WorkBookViewForData.ActiveWorksheet.Cells["A1"].Value="1"; WorkBookViewForData.ActiveWorksheet.Cells["A2"].Value="2"; WorkBookViewForData.ActiveWorksheet.Cells["A3"].Value="3"; 

where WorkBookViewForData is the name of the SpreadsheetGear control

+1
source

Try using the following:

 totalCell.Formula = "=SUM(C6,C11,C16,C21)"; 

Follow the following link for the detailed code:

http://www.spreadsheetgear.com/support/samples/srcview.aspx?file=outline.aspx

Hope this will be helpful.

0
source

All Articles