Subtraction between to excel column using VBScript

前端 未结 2 545
猫巷女王i
猫巷女王i 2021-01-28 01:39

Suppose I have below excel sheet,And I need to find the difference between them and result need to put back to another column:

      ColA                      Co         


        
2条回答
  •  隐瞒了意图╮
    2021-01-28 02:26

    using the range object, I can set the formula on all the cells within a range at once

    range("C1:C10").Formula="=B1-A1"
    

    It will also adjust the formula based on the normal copying riles for absolute addressing.

    e.g. with the above example, C10 will be =B10-A10. If I had put the formula as "=B1-$A$1" then C10 would have been =B10-$A$1

提交回复
热议问题