【问题标题】:Excel, Adding Specific Columns for Multiple RowsExcel,为多行添加特定列
【发布时间】:2012-11-20 20:25:38
【问题描述】:

如果我有这样的表:

  |A|B|C|D|
1 |1|0|1|
2 |4|4|2|
3 |7|2|3|
4 |5|7|2|
5 |3|9|1|

是否可以将 A 列与 C 列相加,并在 D 中显示结果“=SUM(A1,C3)” 但 我想自动执行大约 50 行,这样:

D1=SUM(A1,C3), D2=SUM(A2,C2), D3=SUM(A3,C3)...D50=SUM(A50,C50)

谢谢!

【问题讨论】:

    标签: excel sum row excel-formula


    【解决方案1】:

    如果 但我想自动化这个你的意思是 VBA,那么试试这个

    Sub Demo()
        Dim rng As Range
        ' Set rng to the required range, by whatever means needed
        Set rng = [D1:D50]
        ' Set Formulas of the range
        rng.FormulaR1C1 = "=SUM(RC[-3],RC[-1])"
    End Sub
    

    【讨论】: