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