ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Fill Down based on count in another sheet (https://www.excelbanter.com/excel-programming/442051-fill-down-based-count-another-sheet.html)

LostInNY

Fill Down based on count in another sheet
 
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.

ozgrid.com

Fill Down based on count in another sheet
 
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



--
Regards
Dave Hawley
www.ozgrid.com
"LostInNY" wrote in message
...
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.



LostInNY

Fill Down based on count in another sheet
 
Works great Dave Thanks!!

"ozgrid.com" wrote:

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



--
Regards
Dave Hawley
www.ozgrid.com
"LostInNY" wrote in message
...
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.




All times are GMT +1. The time now is 09:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com