Change a row of cells to be a certain formula
I have this row of data with actual numbers.
For a specific reason ... I need to update the same row of cells to do the following:
=(number from cell same)*$J$5
How can i do this开发者_运维技巧?
Range("$J$5").Copy
Range("B9:Z9").PasteSpecial Operation:=xlMultiply
or, if you need a formula that depends on J5:
For Each c In Range("A10:Z10")
c.Formula = "=$J$5*" & c.Value
Next c
To avoid problems of circular references, just use a copy of the source row.
精彩评论