Hello:
I have a workbook with 2 sheets. Sheet 1 has raw data with variable number of rows (including a header row). Sheet 2 has different formulas based on Sheet 1. It has a header row and row 2 has all the formulas I want to copy down to as many rows as Sheet 1 has. So if Sheet 1 has 30 rows, I would copy down on Sheet 2 formula row which is on column A row 2 to Column A row #30. So far this is what I have but the final step is incomplete as it selects the range but it only copies the formula row to one row and not to the entire range:
Sub Output()
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets("RawData")
Dim nrows As Long
nrows = sh.Range("A1", sh.Range("A1").End(xlDown).End(xlDown).End(xlUp)).Rows.Count
Sheets("Formulas").Select
Range("A2").Select
Range(Selection, Selection.End(xlToRight)).Copy
Sheets("Formulas").Rows("3:" & nrows).Select
Selection.PasteSpecial
End Sub
I have a workbook with 2 sheets. Sheet 1 has raw data with variable number of rows (including a header row). Sheet 2 has different formulas based on Sheet 1. It has a header row and row 2 has all the formulas I want to copy down to as many rows as Sheet 1 has. So if Sheet 1 has 30 rows, I would copy down on Sheet 2 formula row which is on column A row 2 to Column A row #30. So far this is what I have but the final step is incomplete as it selects the range but it only copies the formula row to one row and not to the entire range:
Sub Output()
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets("RawData")
Dim nrows As Long
nrows = sh.Range("A1", sh.Range("A1").End(xlDown).End(xlDown).End(xlUp)).Rows.Count
Sheets("Formulas").Select
Range("A2").Select
Range(Selection, Selection.End(xlToRight)).Copy
Sheets("Formulas").Rows("3:" & nrows).Select
Selection.PasteSpecial
End Sub