Fill Down based on count in another sheet

  • Thread starter Thread starter LostInNY
  • Start date Start date
L

LostInNY

I am using the following in Excel to copy a formula:

ThisWorkbook.Worksheets("Results 4").Range("3:2000").FillDown

I need to only copy the formula for a certain number of rows up to 2000.
The number of rows I need is based on the number of rows I have in worksheet
"Results Data" in column A. So, if "Results Data" has data in column A2:A16,
I will need to copy down the formula for all columns in worksheet "Results 4"
to column 17.
 
Sub FillFown()
Dim lStop As Long

With Worksheets("Results Data")
lStop = .Cells(.Rows.Count, "A").End(xlUp).Row
End With
Worksheets("Results 4").Range("3:" & lStop).FillDown
End Sub
 
Works great Dave Thanks!!

ozgrid.com said:
Sub FillFown()
Dim lStop As Long

With Worksheets("Results Data")
lStop = .Cells(.Rows.Count, "A").End(xlUp).Row
End With
Worksheets("Results 4").Range("3:" & lStop).FillDown
End Sub
 
Back
Top