Making macros loop
One way:
Public Sub InsertFormula()
Const sFORMULA As String = "=SUM($A$1:A1)"
Range("A1:A" & Range("A" & Rows.Count).End( _
xlUp).Row).Offset(0, 1).Formula = sFORMULA
End Sub
In article ,
McKCollins wrote:
I have two columns, A and B. Column A has data, column B contains a formula.
I want the formula in column B to loop down the rows (ie: B1, B2, B3 etc)
until it reaches a blank in column A. I have tried Do Loop...While but I
cannot make the loop work.
Can anyone help with this?
Many thanks.
Collins
|