4

Is it possible to set the Formula on Column First Say "=SUM(A1:A10)" and after that Display the value in A1 to A10 Cells and after that do the calculation.

4

2 回答 2

1

是的,我得到了答案。在为此做一些 RND 时,我意识到 Furmula 操作不适用于

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"

但适用于

   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";

其中 WorkBookViewForData 是 SpreadsheetGear 控件的名称

于 2013-04-18T00:47:40.583 回答
0

尝试使用以下内容:

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

通过以下链接获取详细代码:

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

希望它有帮助。

于 2013-04-17T05:00:34.200 回答