【问题标题】:SpreadsheetGear Column Sum CalculationSpreadsheetGear 列总和计算
【发布时间】:2019-07-08 16:41:15
【问题描述】:

是否可以在列上设置公式首先说“=SUM(A1:A10)”,然后在 A1 到 A10 单元格中显示值,然后进行计算。

【问题讨论】:

  • 交换前两个词。是吗……

标签: c# excel


【解决方案1】:

是的,我得到了答案。在为此做一些 R N D 时,我意识到 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 控件的名称

【讨论】:

    【解决方案2】:

    尝试使用以下内容:

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

    查看以下链接获取详细代码:

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

    希望对您有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-01-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-25
      • 2014-06-23
      • 2013-05-26
      相关资源
      最近更新 更多