Adding sum formula between every space ranges by vba

后端 未结 2 713
逝去的感伤
逝去的感伤 2021-01-28 14:48

I was trying to do an automation and i was stuck here, where i need to add sum formula dynamically in between the space ranges. I\'m completely lost here for adding formula usin

2条回答
  •  暖寄归人
    2021-01-28 15:37

    Without VBA:

    Say we have data in column A like:

    and we want to calculate of sum of each of the blocks separated by a blank cell. In B2 enter:

    =IF(A2<>"","",SUM($A$1:A2)-SUM($B$1:B1))
    

    and copy down:

    If this is of no value, I will delete the answer.

提交回复
热议问题