Drag/Pull Formulas side ways using VBA
Posted on 2011-10-20
I have a cell which would require a large formula which is on the next cell (adjasent)
A2 (is empty) and B2 has formula
I want the formula on B2 to be dragged to A2. The reason being, this is the only way the values inside the formulas change according to A2 (and incorporate it)
Again, this is because the formula in B2 uses the data in B1 (hence the formula in A2 should use data in A1)
If I use this
Range("A2").Formula = Range("B2").Formula
Then it just copies the formula which still references to data in B1.
Example aside; I am currently using this:
Cells(5, count) (desitination cell)
Cells(5, count - 1) (formula cell)
When I drag the formula sideways to A2, then everything inside the formula changes. Is there any other way to do this?