PDA

View Full Version : Solved: Copying formula down used range



Anomandaris
11-12-2009, 02:26 AM
I’ve got a sheet that will have a lot of values in Columns A:V. The Rows are variable, sometimes may have 20 rows, sometimes 100. Columns W:Z have formulae that I need dragged down to calculate the used range of rows.

I have a formula but it only does it for 1 additional row, I’m not sure how to adjust it.
Please advise.
Thanks


Dim NextRw as long
NextRw = .Cells(.Rows.Count, 1).End(xlUp).Row + 1
Range(.Cells(NextRw, 23), .Cells(NextRw, 26)).FormulaR1C1 = _
Range(.Cells(2, 23), .Cells(2, 26)).FormulaR1C1

Bob Phillips
11-12-2009, 02:55 AM
Sub AddFormulae()
Dim Lastrow As Long

With ActiveSheet

Lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row
.Range("W2:Z2").AutoFill .Range("W2:Z2").Resize(Lastrow - 1)
End With
End Sub

Anomandaris
11-12-2009, 04:06 AM
Thanks xld........works as required!