drag-driver
Board Regular
- Joined
- Feb 18, 2002
- Messages
- 91
Need to copy formulae but want formulae to iterate as well, Need it to multiply with referance to other cells. Last solution just copys the exact formulae without iterrate the formulae. Ie
Sub Test()
Dim CopyTimes As Integer
Dim CopyLoop As Integer
CopyTimes = Worksheets("sheet1").Range("A1").Value
If CopyTimes <= 1 Then Exit Sub
For CopyLoop = 1 To CopyTimes
'assume A2 has the data, B2 is the place to start storeing
Worksheets("sheet1").Range("B" & CopyLoop + 1).Formula = Worksheets("sheet1").Range("A2").Formula
Next CopyLoop
End Sub
This solution copys the formulae which in my case is "=exact(d2,d3)" all the way down as
"=exact(d2,d3)" I require that it goes like this , "=exact(d3,d4)", then "=exact(d4,d5)" and so fourth.
Sub Test()
Dim CopyTimes As Integer
Dim CopyLoop As Integer
CopyTimes = Worksheets("sheet1").Range("A1").Value
If CopyTimes <= 1 Then Exit Sub
For CopyLoop = 1 To CopyTimes
'assume A2 has the data, B2 is the place to start storeing
Worksheets("sheet1").Range("B" & CopyLoop + 1).Formula = Worksheets("sheet1").Range("A2").Formula
Next CopyLoop
End Sub
This solution copys the formulae which in my case is "=exact(d2,d3)" all the way down as
"=exact(d2,d3)" I require that it goes like this , "=exact(d3,d4)", then "=exact(d4,d5)" and so fourth.