Set formula to a range of cells

后端 未结 6 2035
日久生厌
日久生厌 2020-12-03 03:40

this is simple demo of what i want to do. I want to set a formula to a range of cells(eg. C1 to C10).

Range(\"C1\").Formula = \"=A1+B1\"

bu

6条回答
  •  误落风尘
    2020-12-03 03:57

    I think this is the simplest answer possible: 2 lines and very comprehensible. It emulates the functionality of dragging a formula written in a cell across a range of cells.

    Range("C1").Formula = "=A1+B1"
    Range("C1:C10").FillDown
    

提交回复
热议问题