0

如果我有一张这样的桌子:

  |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)

谢谢!

4

1 回答 1

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
于 2012-11-21T05:44:09.867 回答